android - Share text with SMS on Samsung Galaxy S5 -


i trying share text through sms. looks fine on of phones, samsung phones, except on galaxy s5.

here code:

public static void sharewithsms(@nonnull context context, @nullable string text) {     intent intent = new intent(intent.action_view, uri.fromparts("sms", "", null));     intent.settype("vnd.android-dir/mms-sms");     intent.putextra("sms_body", text);     context.startactivity(intent); } 

it launch app sms, without text. know why?

update

the aim launch sms app of device, not send sms. that's why not using smsmanager.

you have 2 method so.one of them using smsmanager()and other 1 using intent use code send message:

    intent smsintent = new intent(intent.action_view);             smsintent.settype("vnd.android-dir/mms-sms");             smsintent.putextra("sms_body", getstring(r.string.social_invitation));             startactivity(smsintent); 

enjoy code:)


Comments