Friday, December 11, 2015

How to get the package name of default sms app


Code snippet for getting the default package name of SMS

for below kitkat

String defApp = Settings.Secure.getString(getContentResolver(), "sms_default_application");
PackageManager pm = getApplicationContext().getPackageManager();
Intent iIntent = pm.getLaunchIntentForPackage(defApp);
ResolveInfo mInfo = pm.resolveActivity(iIntent,0);
Log.i(TAG, "apk:"+mInfo.activityInfo.packageName);
above or equal to kitkat

Telephony.Sms.getDefaultSmsPackage(this)


No comments:

Post a Comment

Androidians