Fixes issue #2

by removing singleinstance from MainActivity in the manifest and handling the launch in AppShortcutLauncherActivity
This commit is contained in:
Adrian Campos 2017-03-22 14:25:51 -07:00 committed by Karim Abou Zeid
commit d17f0407dd
2 changed files with 6 additions and 3 deletions

View file

@ -84,6 +84,9 @@ public class AppShortcutLauncherActivity extends Activity {
//Put the bundle in the intent
intent.putExtras(bundle);
//If MainActivity's already running, don't launch another instance. Instead, bring it to the top and deliver the intent to onNewIntent()
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
//Finally, start MainActivity with those extras
startActivity(intent);
}