Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open sms app via implicit intent?

I follow this code:

    Intent intent = new Intent(Intent.ACTION_MAIN);
    intent.addCategory(Intent.CATEGORY_DEFAULT);
    intent.setType("vnd.android-dir/mms-sms");
    startActivity(intent);

It work up to android 5.1, but doesn't work android 6.0, because android.content.ActivityNotFoundException: No Activity found to handle Intent. So, how to open sms app via implicit intent?

EDIT:

  1. You read my post? I need open app, not send message.

  2. I check this post, but it doesn't work!

like image 718
D. Wayne Avatar asked May 09 '16 09:05

D. Wayne


1 Answers

You can try this, it work for me:

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_APP_MESSAGING);
startActivity(intent);
like image 178
Sergey Molyak Avatar answered Sep 28 '22 09:09

Sergey Molyak