Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how could I get default sms app's package name?

Tags:

android

sms

As default sms app is added in 4.4, I cannot open default sms app like this:

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

So how could I get default sms app's package name, so I can open it from my app directly?

like image 885
thecr0w Avatar asked Sep 22 '14 07:09

thecr0w


1 Answers

The accepted answer did not work for me (and seems rather unreliable).

A better way to get the package name is

Telephony.Sms.getDefaultSmsPackage(context);

This requires API 19+

like image 114
Force Avatar answered Oct 25 '22 05:10

Force