diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2014-10-15 00:39:57 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-15 00:39:58 +0000 |
commit | 94dce7618584b4ca51bf17937cbd6cb0c22aaaea (patch) | |
tree | 58a91fc181ea59e112281838d3efcf21768d74ce /src/com | |
parent | eaf84472ea10e0ec34b22faad0438700a86787b9 (diff) | |
parent | 3e825febca4daed4ec1baec5f94ef2b067c650fb (diff) | |
download | packages_apps_Settings-94dce7618584b4ca51bf17937cbd6cb0c22aaaea.tar.gz packages_apps_Settings-94dce7618584b4ca51bf17937cbd6cb0c22aaaea.tar.bz2 packages_apps_Settings-94dce7618584b4ca51bf17937cbd6cb0c22aaaea.zip |
Merge "Fix bug #17976062 Stability: ISE in Settings: Fragment ApnSettings{4da9ae0} not attached to Activity" into lmp-dev
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/ApnSettings.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/settings/ApnSettings.java b/src/com/android/settings/ApnSettings.java index d214df2ef..0c0e53cd9 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(); |