diff options
author | Ben Murdoch <benm@google.com> | 2011-08-11 10:30:08 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-11 10:30:08 -0700 |
commit | 132a9ceebaf87e206380316bf7a81924e21fed59 (patch) | |
tree | 6804a2eb191ede08ab4f75bbd9fdf42e12a724ff | |
parent | 6747e0a22235ee1652e81f40e62828268f30c1cb (diff) | |
parent | 381280d263748055bda5df3bf7d1d10b65b85f5c (diff) | |
download | packages_apps_Browser-132a9ceebaf87e206380316bf7a81924e21fed59.zip packages_apps_Browser-132a9ceebaf87e206380316bf7a81924e21fed59.tar.gz packages_apps_Browser-132a9ceebaf87e206380316bf7a81924e21fed59.tar.bz2 |
Merge "Fix potential NPE when saving/deleting Autofill profile."
-rw-r--r-- | src/com/android/browser/AutoFillSettingsFragment.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/com/android/browser/AutoFillSettingsFragment.java b/src/com/android/browser/AutoFillSettingsFragment.java index 141de34..04f45b5 100644 --- a/src/com/android/browser/AutoFillSettingsFragment.java +++ b/src/com/android/browser/AutoFillSettingsFragment.java @@ -116,16 +116,21 @@ public class AutoFillSettingsFragment extends Fragment { mHandler = new Handler() { @Override public void handleMessage(Message msg) { + Context c = getActivity(); switch (msg.what) { case PROFILE_SAVED_MSG: - Toast.makeText(getActivity(), R.string.autofill_profile_successful_save, - Toast.LENGTH_SHORT).show(); - closeEditor(); + if (c != null) { + Toast.makeText(c, R.string.autofill_profile_successful_save, + Toast.LENGTH_SHORT).show(); + closeEditor(); + } break; case PROFILE_DELETED_MSG: - Toast.makeText(getActivity(), R.string.autofill_profile_successful_delete, - Toast.LENGTH_SHORT).show(); + if (c != null) { + Toast.makeText(c, R.string.autofill_profile_successful_delete, + Toast.LENGTH_SHORT).show(); + } break; } } |