summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorFabrice Di Meglio <fdimeglio@google.com>2014-10-15 00:53:43 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-15 00:53:43 +0000
commit5e91648077f8f0765aa8628d0e99accfe2f87383 (patch)
tree9057890b959c243042feede17c1eefda95fd3063 /src/com
parent40103896b08fbd4b8d191fc2805ec8f482d22d17 (diff)
parent6b68b000da5db8df9228ae9f589dfb1f2b38759b (diff)
downloadpackages_apps_Settings-5e91648077f8f0765aa8628d0e99accfe2f87383.zip
packages_apps_Settings-5e91648077f8f0765aa8628d0e99accfe2f87383.tar.gz
packages_apps_Settings-5e91648077f8f0765aa8628d0e99accfe2f87383.tar.bz2
am 6b68b000: am 94dce761: Merge "Fix bug #17976062 Stability: ISE in Settings: Fragment ApnSettings{4da9ae0} not attached to Activity" into lmp-dev
* commit '6b68b000da5db8df9228ae9f589dfb1f2b38759b': Fix bug #17976062 Stability: ISE in Settings: Fragment ApnSettings{4da9ae0} not attached to Activity
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/ApnSettings.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java
index d214df2..0c0e53c 100644
--- a/src/com/android/settings/ApnSettings.java
+++ b/src/com/android/settings/ApnSettings.java
@@ -16,6 +16,7 @@
package com.android.settings;
+import android.app.Activity;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
@@ -171,8 +172,6 @@ public class ApnSettings extends SettingsPreferenceFragment implements
if (!mRestoreDefaultApnMode) {
fillList();
- } else {
- showDialog(DIALOG_RESTORE_DEFAULTAPN);
}
}
@@ -348,12 +347,17 @@ public class ApnSettings extends SettingsPreferenceFragment implements
public void handleMessage(Message msg) {
switch (msg.what) {
case EVENT_RESTORE_DEFAULTAPN_COMPLETE:
+ Activity activity = getActivity();
+ if (activity == null) {
+ mRestoreDefaultApnMode = false;
+ return;
+ }
fillList();
getPreferenceScreen().setEnabled(true);
mRestoreDefaultApnMode = false;
removeDialog(DIALOG_RESTORE_DEFAULTAPN);
Toast.makeText(
- getActivity(),
+ activity,
getResources().getString(
R.string.restore_default_apn_completed),
Toast.LENGTH_LONG).show();