@Override protected void onRestoreInstanceState(Parcelable state) { if (!(state instanceof FindPanelSavedState)) { super.onRestoreInstanceState(state); return; } FindPanelSavedState ss = (FindPanelSavedState) state; super.onRestoreInstanceState(ss.getSuperState()); // default visibility of _replaceBar is GONE if (ss.replaceBarVisibility == VISIBLE) { _replaceBar.setVisibility(VISIBLE); _toggleReplaceBar.setImageResource(R.drawable.arrow_up); } _caseSensitive.setChecked(ss.optionsCaseSensitive); _matchWholeWord.setChecked(ss.optionsWholeWord); if (ss.optionsDialogShown) { _optionsDialog.show(); } }