From bbb91e8ecaa64c8cae8561ef6618c3dae1cc3bfe Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 15 Jul 2014 12:19:17 -0400 Subject: [PATCH] fix bug where "app repo" dialog gets created twice for an incoming Intent onNewIntent() is called because ManageReposActivity is set to "singleTask" launchMode, but it is only called if ManageReposActivity is already running. onResume() is always called, and called after onNewIntent() if it is called, so use onNewIntent() only to set the current Intent, then parse the Intent only in onResume(). Here is how to reproduce the original bug: 1. Close F-Droid properly and start it again. 2. Click on https://guardianproject.info/fdroid/repo in a browser (and tell it to open with F-Droid) 3. Hit cancel on the add repo dialog 4. Leave F-Droid open and switch back to the browser 5. Open that link again. This should result in two dialogs on top of one another. Happened from both Firefox, Chrome, and Android browsers. --- src/org/fdroid/fdroid/views/ManageReposActivity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/org/fdroid/fdroid/views/ManageReposActivity.java b/src/org/fdroid/fdroid/views/ManageReposActivity.java index 93c383c6b..7c22c7c5d 100644 --- a/src/org/fdroid/fdroid/views/ManageReposActivity.java +++ b/src/org/fdroid/fdroid/views/ManageReposActivity.java @@ -154,7 +154,7 @@ public class ManageReposActivity extends ActionBarActivity { @Override protected void onNewIntent(Intent intent) { - addRepoFromIntent(intent); + setIntent(intent); } @Override