Skip to content

Commit fb5f1bc

Browse files
committed
Log a warning when action bar view states cannot be restored.
Some apps can get into a case where the saved view hierarchy states for action bar views are missing. Log a warning instead of crashing. Bug 6510800 Change-Id: I95ede64ec584892e6e76ca9ab9d53e9d3689984f
1 parent f82e769 commit fb5f1bc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

policy/src/com/android/internal/policy/impl/PhoneWindow.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,12 @@ public void restoreHierarchyState(Bundle savedInstanceState) {
16301630
if (mActionBar != null) {
16311631
SparseArray<Parcelable> actionBarStates =
16321632
savedInstanceState.getSparseParcelableArray(ACTION_BAR_TAG);
1633-
mActionBar.restoreHierarchyState(actionBarStates);
1633+
if (actionBarStates != null) {
1634+
mActionBar.restoreHierarchyState(actionBarStates);
1635+
} else {
1636+
Log.w(TAG, "Missing saved instance states for action bar views! " +
1637+
"State will not be restored.");
1638+
}
16341639
}
16351640
}
16361641

0 commit comments

Comments
 (0)