I am trying to open System default Messaging activity when clicking on a button. Here is my code:
smsUri = Uri.parse("tel:" + teacherPhone2);
Intent intent = new Intent(Intent.ACTION_VIEW, smsUri);
intent.putExtra("address", teacherPhone);
intent.setType("vnd.android-dir/mms-sms");
startActivity(intent);
It works fine below MarshMallow. But in MarshMallow the app crashes when clicking that button. I have set the user-permission and also requested send sms permission. Can anyone tell me why this happens?