diff --git a/res/layout/reset_network.xml b/res/layout/reset_network.xml
index 2c31d1af29b..9181ed8a20b 100644
--- a/res/layout/reset_network.xml
+++ b/res/layout/reset_network.xml
@@ -19,7 +19,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
-
-
-
-
-
-
-
-
-
+ android:gravity="center"
+ style="@style/ActionPrimaryButton"/>
diff --git a/res/layout/reset_network_confirm.xml b/res/layout/reset_network_confirm.xml
index 0e5327f5b28..1ec446ea245 100644
--- a/res/layout/reset_network_confirm.xml
+++ b/res/layout/reset_network_confirm.xml
@@ -17,23 +17,25 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
-
-
-
-
+ android:gravity="center"
+ style="@style/ActionPrimaryButton"/>
diff --git a/src/com/android/settings/ResetNetworkConfirm.java b/src/com/android/settings/ResetNetworkConfirm.java
index f457bbc4615..beb0528f6a9 100644
--- a/src/com/android/settings/ResetNetworkConfirm.java
+++ b/src/com/android/settings/ResetNetworkConfirm.java
@@ -72,6 +72,7 @@ public class ResetNetworkConfirm extends InstrumentedFragment {
@VisibleForTesting Activity mActivity;
private int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
private ProgressDialog mProgressDialog;
+ private AlertDialog mAlertDialog;
/**
* Async task used to do all reset task. If error happens during
@@ -141,7 +142,7 @@ public class ResetNetworkConfirm extends InstrumentedFragment {
Toast.makeText(mContext, R.string.reset_network_complete_toast, Toast.LENGTH_SHORT)
.show();
} else {
- new AlertDialog.Builder(mContext)
+ mAlertDialog = new AlertDialog.Builder(mContext)
.setTitle(R.string.reset_esim_error_title)
.setMessage(R.string.reset_esim_error_msg)
.setPositiveButton(android.R.string.ok, null /* listener */)
@@ -265,6 +266,12 @@ public class ResetNetworkConfirm extends InstrumentedFragment {
mResetNetworkTask.cancel(true /* mayInterruptIfRunning */);
mResetNetworkTask = null;
}
+ if (mProgressDialog != null) {
+ mProgressDialog.dismiss();
+ }
+ if (mAlertDialog != null) {
+ mAlertDialog.dismiss();
+ }
super.onDestroy();
}