Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Fix main UI refresh when clearing all XPrivacy data
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymanou committed Aug 29, 2014
1 parent 0be314d commit 79bc42e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/biz/bokhorst/xprivacy/ActivityMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class ActivityMain extends ActivityBase implements OnItemSelectedListener
private static final int ERROR_NON_MATCHING_UID = 0x103;

public static final Uri cProUri = Uri.parse("http://www.xprivacy.eu/");
public static final String cRefreshUI = "RefreshUI";

private static ExecutorService mExecutor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(),
new PriorityThreadFactory());
Expand Down Expand Up @@ -360,6 +361,12 @@ protected void onNewIntent(Intent intent) {

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)) {
((EditText) findViewById(R.id.etFilter)).setText("");
recreate();
}
}

@Override
Expand Down
7 changes: 5 additions & 2 deletions src/biz/bokhorst/xprivacy/ActivitySettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,11 +521,14 @@ private void clearDB() {
@Override
public void onClick(DialogInterface dialog, int which) {
PrivacyManager.clear();
((EditText) ActivitySettings.this.findViewById(R.id.etFilter)).setText("");
recreate();
Toast.makeText(ActivitySettings.this, getString(R.string.msg_reboot), Toast.LENGTH_LONG)
.show();
finish();

// Refresh main UI
Intent intent = new Intent(ActivitySettings.this, ActivityMain.class);
intent.putExtra(ActivityMain.cRefreshUI, true);
startActivity(intent);
}
});
alertDialogBuilder.setNegativeButton(getString(android.R.string.cancel),
Expand Down

0 comments on commit 79bc42e

Please sign in to comment.