Fix the multiple instences of NetworkProviderSettingsActivity issue
- Use the command "adb shell dumpsys window" to dump how many
activities/windows currently on the system.
Then search for section like "Task display areas in top down Z order"
Bug: 191956700
Test: manual test
Use "adb shell dumpsys window" to check no more multiple instences
Change-Id: Ie9e04db3db601fbeee9beceedb81929cd6eba439
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index 75e6307..59f6504 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -233,6 +233,9 @@
if (FeatureFlagUtils.isEnabled(getContext(), FeatureFlagUtils.SETTINGS_PROVIDER_MODEL)) {
final Intent intent = new Intent("android.settings.NETWORK_PROVIDER_SETTINGS");
+ // Add FLAG_ACTIVITY_NEW_TASK and FLAG_ACTIVITY_CLEAR_TASK to avoid multiple
+ // instances issue. (e.g. b/191956700)
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
final Bundle extras = getActivity().getIntent().getExtras();
if (extras != null) {
intent.putExtras(extras);