Reputation: 145
How can I know which is the package name of default system app if user has one defined? By example get the package name of system default music app to stop it
Upvotes: 0
Views: 477
Reputation: 145
solved:
String mKillAppName = null; headsetPlugIntent = Intent.makeMainSelectorActivity(Intent.ACTION_MAIN, Intent.CATEGORY_APP_MUSIC); ResolveInfo da = mContext.getPackageManager() .resolveActivity(headsetPlugIntent,PackageManager.MATCH_DEFAULT_ONLY); mKillAppName = da.activityInfo.packageName;
Upvotes: 1