From 7444e147a863b41e08815658f1bcbe426aba512b Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 21 May 2009 12:54:16 -0700 Subject: [PATCH] Fixes external http://code.google.com/p/android/issues/detail?id=2732. ExpandableListView is wrongly assuming that the saved state if of the correct type. A similar bug fix was made in TextView.onRestoreInstanceState() a while ago. This fix simply ensures that the state received is of the right type. --- core/java/android/widget/ExpandableListView.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/java/android/widget/ExpandableListView.java b/core/java/android/widget/ExpandableListView.java index 0fc8f495d8c40..536062168e616 100644 --- a/core/java/android/widget/ExpandableListView.java +++ b/core/java/android/widget/ExpandableListView.java @@ -1083,6 +1083,11 @@ public class ExpandableListView extends ListView { @Override public void onRestoreInstanceState(Parcelable state) { + if (!(state instanceof SavedState)) { + super.onRestoreInstanceState(state); + return; + } + SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState());