Merge "Fix Java crash problem" into main

This commit is contained in:
Treehugger Robot
2023-12-14 14:12:27 +00:00
committed by Android (Google) Code Review

View File

@@ -81,7 +81,8 @@ public class SpinnerPreference extends Preference {
return; return;
} }
if (!(state instanceof SavedState)) { if (!(state instanceof SavedState)) {
super.onRestoreInstanceState(state); // To avoid the IllegalArgumentException, return the BaseSavedState.EMPTY_STATE.
super.onRestoreInstanceState(BaseSavedState.EMPTY_STATE);
return; return;
} }
SavedState savedState = (SavedState) state; SavedState savedState = (SavedState) state;