diff --git a/src/biz/bokhorst/xprivacy/ActivityMain.java b/src/biz/bokhorst/xprivacy/ActivityMain.java index e618169d3..e8b6e9d73 100644 --- a/src/biz/bokhorst/xprivacy/ActivityMain.java +++ b/src/biz/bokhorst/xprivacy/ActivityMain.java @@ -100,7 +100,8 @@ public class ActivityMain extends ActivityBase implements OnItemSelectedListener private static final int ERROR_INVALID_PACKAGE_NAME = 0x102; private static final int ERROR_NON_MATCHING_UID = 0x103; - public static final String cRefreshUI = "RefreshUI"; + public static final String cAction = "Action"; + public static final int cActionRefresh = 1; public static final Uri cProUri = Uri.parse("http://www.xprivacy.eu/"); @@ -327,17 +328,19 @@ protected void onResume() { @Override protected void onNewIntent(Intent intent) { - // Refresh application list - if (mAppAdapter != null) - mAppAdapter.notifyDataSetChanged(); - - // Import pro license - if (Intent.ACTION_VIEW.equals(intent.getAction())) - Util.importProLicense(new File(intent.getData().getPath())); - // Handle clear XPrivacy data (needs UI refresh) - if (intent.hasExtra(cRefreshUI)) + Bundle extras = intent.getExtras(); + if (extras != null && extras.containsKey(cAction) && extras.getInt(cAction) == cActionRefresh) recreate(); + else { + // Refresh application list + if (mAppAdapter != null) + mAppAdapter.notifyDataSetChanged(); + + // Import pro license + if (Intent.ACTION_VIEW.equals(intent.getAction())) + Util.importProLicense(new File(intent.getData().getPath())); + } } @Override diff --git a/src/biz/bokhorst/xprivacy/ActivitySettings.java b/src/biz/bokhorst/xprivacy/ActivitySettings.java index d47fb6cbb..18c8983c4 100644 --- a/src/biz/bokhorst/xprivacy/ActivitySettings.java +++ b/src/biz/bokhorst/xprivacy/ActivitySettings.java @@ -518,6 +518,7 @@ public void onClick(DialogInterface dialog, int which) { // Refresh main UI Intent intent = new Intent(ActivitySettings.this, ActivityMain.class); + intent.putExtra(ActivityMain.cAction, ActivityMain.cActionRefresh); startActivity(intent); } }); @@ -723,7 +724,6 @@ private void optionSave() { // Refresh view if (uid == userId) { Intent intent = new Intent(ActivitySettings.this, ActivityMain.class); - intent.putExtra(ActivityMain.cRefreshUI, true); startActivity(intent); } else { Intent intent = new Intent(ActivitySettings.this, ActivityApp.class);