List of usage examples for android.content.pm PackageManager clearPackagePreferredActivities
public abstract void clearPackagePreferredActivities(String packageName);
From source file:Main.java
public static void clearMyDefaultBrowser(Context context) { PackageManager pm = context.getPackageManager(); pm.clearPackagePreferredActivities(context.getPackageName()); }
From source file:Main.java
public static void clearDefaultOpenSetting(Context mContext) { PackageManager pm = mContext.getPackageManager(); pm.clearPackagePreferredActivities(mContext.getPackageName()); }
From source file:uk.co.droidinactu.ebooklauncher.EBookLauncherActivity.java
@Override public boolean onOptionsItemSelected(final MenuItem item) { boolean retvalue = false; switch (item.getItemId()) { case MENU_PREFERENCES: startActivityForResult(new Intent(getApplication(), EditPreferences.class), EBookLauncherActivity.ACTIVITY_EDIT_PREFERENCES); retvalue = true;/*from w w w . ja va 2 s.c o m*/ break; case MENU_SETTINGS: startActivity(new Intent(android.provider.Settings.ACTION_SETTINGS)); retvalue = true; break; case MENU_CHECK_NEW_VERSION: final Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(EBookLauncherActivity.DOWNLOAD_APK_URL)); startActivity(i); break; case MENU_CLEAR_DEFAULTS: final PackageManager pm = getPackageManager(); pm.clearPackagePreferredActivities("uk.co.droidinactu.ebooklauncher"); pm.clearPackagePreferredActivities("com.android.launcher"); retvalue = true; break; case MENU_ABOUT: this.showAboutWithExtras(); retvalue = true; break; default: return super.onOptionsItemSelected(item); } return retvalue; }