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



Popular posts from this blog

Open Gallery and get the selected image in appplication

AlarmManager and Notification in Android

Dismiss or Cancel dialog by swipe gesture