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.
This commit is contained in:
Hans-Christoph Steiner 2014-07-15 12:19:17 -04:00
parent 182aea0f98
commit bbb91e8eca

View File

@ -154,7 +154,7 @@ public class ManageReposActivity extends ActionBarActivity {
@Override
protected void onNewIntent(Intent intent) {
addRepoFromIntent(intent);
setIntent(intent);
}
@Override