diff options
author | Amith Yamasani <yamasani@google.com> | 2012-05-01 16:15:25 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-01 16:15:25 -0700 |
commit | 9593b743cb625e88b97b2674c5f528bb07f96011 (patch) | |
tree | 4770dc094e52e16802d133895d3742936c69d92f | |
parent | de3c9cb412688eb841993ad971d06039d8a952c3 (diff) | |
parent | 3b7dbcecf70788df4950340cbf750dbe524dca96 (diff) | |
download | packages_apps_settings-9593b743cb625e88b97b2674c5f528bb07f96011.zip packages_apps_settings-9593b743cb625e88b97b2674c5f528bb07f96011.tar.gz packages_apps_settings-9593b743cb625e88b97b2674c5f528bb07f96011.tar.bz2 |
Merge "Fix NPE in ManageApps when switching orientation." into jb-dev
-rw-r--r-- | src/com/android/settings/applications/ManageApplications.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/applications/ManageApplications.java b/src/com/android/settings/applications/ManageApplications.java index fbaabf4..8a64968 100644 --- a/src/com/android/settings/applications/ManageApplications.java +++ b/src/com/android/settings/applications/ManageApplications.java @@ -539,7 +539,7 @@ public class ManageApplications extends Fragment implements } mDefaultTab = defaultTabTag; - + final Intent containerIntent = new Intent().setComponent( StorageMeasurement.DEFAULT_CONTAINER_COMPONENT); getActivity().bindService(containerIntent, mContainerConnection, Context.BIND_AUTO_CREATE); @@ -759,6 +759,9 @@ public class ManageApplications extends Fragment implements static final int VIEW_RUNNING = 2; void updateStorageUsage() { + // Fragment view not yet created? + if (mRootView == null) return; + if (mCurView == VIEW_RUNNING) { return; } @@ -939,6 +942,8 @@ public class ManageApplications extends Fragment implements @Override public void onServiceConnected(ComponentName name, IBinder service) { mContainerService = IMediaContainerService.Stub.asInterface(service); + // Make sure this callback didn't come at an inopportune time. + if (getActivity() == null) return; updateStorageUsage(); } |