android - Marshmallow message application is not opening -


i trying open message application application getting activitynotfoundexception in marshmallow. used below code:

intent n = new intent(intent.action_view); n.settype("vnd.android-dir/mms-sms"); n.putextra("address", phone); n.putextra("sms_body", " "); startactivity(n); 

i use code on android m , works:

intent n = new intent(intent.action_view); n.setdata(uri.parse("sms:")); n.putextra("address", phone); n.putextra("sms_body", " "); startactivity(n); 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -