-1

I want to open my default SMS application with intent from my application and to send LINK to some webpage , but when I try code bellow , sms app want recognize link . My current code is

            Intent smsIntent = new Intent(Intent.ACTION_VIEW);
            smsIntent.setType("vnd.android-dir/mms-sms");
            smsIntent.putExtra(Intent.EXTRA_TEXT, "https://stackoverflow.com/questions/9290737/android-message-intent");
            startActivity(smsIntent);

I want something like this: enter image description here

eJoe
  • 485
  • 1
  • 7
  • 18

1 Answers1

2

You can try as below:

    Uri smsToUri = Uri.parse( "smsto:" );
    Intent smsIntent = new Intent(Intent.ACTION_VIEW, smsToUri);
    smsIntent.setType("vnd.android-dir/mms-sms");
    smsIntent.putExtra("sms_body", "https://stackoverflow.com/questions/9290737/android-message-intent");
    startActivity(smsIntent);