use launchMode="singleTask", there can be only one SwapWorkflowActivity!
* https://developer.android.com/reference/android/app/Activity.html#onNewIntent(android.content.Intent) * https://developer.android.com/guide/topics/manifest/activity-element#lmode * https://inthecheesefactory.com/blog/understand-android-activity-launchmode/en
This commit is contained in:
parent
289976667d
commit
e98393f092
@ -52,6 +52,7 @@
|
|||||||
android:label="@string/swap"
|
android:label="@string/swap"
|
||||||
android:name=".views.swap.SwapWorkflowActivity"
|
android:name=".views.swap.SwapWorkflowActivity"
|
||||||
android:parentActivityName=".views.main.MainActivity"
|
android:parentActivityName=".views.main.MainActivity"
|
||||||
|
android:launchMode="singleTask"
|
||||||
android:theme="@style/SwapTheme.Wizard"
|
android:theme="@style/SwapTheme.Wizard"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:configChanges="orientation|keyboardHidden">
|
android:configChanges="orientation|keyboardHidden">
|
||||||
|
@ -111,6 +111,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
private Toolbar toolbar;
|
private Toolbar toolbar;
|
||||||
private SwapView currentView;
|
private SwapView currentView;
|
||||||
private boolean hasPreparedLocalRepo;
|
private boolean hasPreparedLocalRepo;
|
||||||
|
private boolean newIntent;
|
||||||
private NewRepoConfig confirmSwapConfig;
|
private NewRepoConfig confirmSwapConfig;
|
||||||
private LocalBroadcastManager localBroadcastManager;
|
private LocalBroadcastManager localBroadcastManager;
|
||||||
private WifiManager wifiManager;
|
private WifiManager wifiManager;
|
||||||
@ -346,6 +347,11 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
new IntentFilter(UpdateService.LOCAL_ACTION_STATUS));
|
new IntentFilter(UpdateService.LOCAL_ACTION_STATUS));
|
||||||
|
|
||||||
checkIncomingIntent();
|
checkIncomingIntent();
|
||||||
|
|
||||||
|
if (newIntent) {
|
||||||
|
showRelevantView();
|
||||||
|
newIntent = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -357,6 +363,13 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
localBroadcastManager.unregisterReceiver(repoUpdateReceiver);
|
localBroadcastManager.unregisterReceiver(repoUpdateReceiver);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onNewIntent(Intent intent) {
|
||||||
|
super.onNewIntent(intent);
|
||||||
|
setIntent(intent);
|
||||||
|
newIntent = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether incoming {@link Intent} is a swap repo, and ensure that
|
* Check whether incoming {@link Intent} is a swap repo, and ensure that
|
||||||
* it is a valid swap URL. The hostname can only be either an IP or
|
* it is a valid swap URL. The hostname can only be either an IP or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user