OSDN Git Service

Fix a race condition when entering and exiting a preference fragment quickly.
authorAmith Yamasani <yamasani@google.com>
Thu, 3 Mar 2011 00:11:31 +0000 (16:11 -0800)
committerAmith Yamasani <yamasani@google.com>
Thu, 3 Mar 2011 00:11:31 +0000 (16:11 -0800)
Bug: 3413715

Fragment was going through STARTED/RESUMED/STARTED/CREATED very quickly and
bindPreferences() was a delayed call that happened after mView was nullified.
Removing the MSG_BIND_PREFERENCES when view is destroyed.

Change-Id: Iec43102c004a266c412b993f17e1a8c1699fb0b1

core/java/android/preference/PreferenceFragment.java

index b96defe..4e22ba0 100644 (file)
@@ -187,6 +187,7 @@ public abstract class PreferenceFragment extends Fragment implements
     public void onDestroyView() {
         mList = null;
         mHandler.removeCallbacks(mRequestFocus);
+        mHandler.removeMessages(MSG_BIND_PREFERENCES);
         super.onDestroyView();
     }