@Override public void onRestoreInstanceState(Parcelable state) { if (!(state instanceof SavedState)) { super.onRestoreInstanceState(state); return; } mSavedState = (SavedState) state; if (mSavedState.isSearchOpen) { showSearch(); setQuery(mSavedState.query, false); } super.onRestoreInstanceState(mSavedState.getSuperState()); }
@Override public void onRestoreInstanceState(Parcelable state) { if (state instanceof Bundle) { Bundle bundle = (Bundle) state; String stateJson = bundle.getString("output_info_json"); mCalculatorOutputInfo = new Gson().fromJson(stateJson, CalculatorOutputInfo.class); showOutputInfo(); state = bundle.getParcelable(TAG); } super.onRestoreInstanceState(state); }
@Override protected void onRestoreInstanceState(Parcelable state) { SavedState savedState = (SavedState) state; super.onRestoreInstanceState(savedState.getSuperState()); searchEnabled = savedState.isSearchBarVisible == VIEW_VISIBLE ? true : false; suggestionsVisible = savedState.suggestionsVisible == VIEW_VISIBLE ? true : false; speechMode = savedState.speechMode == VIEW_VISIBLE ? true : false; setLastSuggestions(savedState.suggestions); if (suggestionsVisible) animateLastRequests(0, getListHeight()); if (searchEnabled) { inputContainer.setVisibility(VISIBLE); searchIcon.setVisibility(GONE); } iconLefttResId = savedState.iconLefttResId; iconRightResId = savedState.iconRightResId; hint = savedState.hint; maxSuggestionCount = savedState.maxSuggestions > 0 ? maxSuggestionCount = savedState.maxSuggestions : maxSuggestionCount; Log.d("LOG_TAG", getClass().getSimpleName() + ": max " + maxSuggestionCount); setupIcons(); }
/* (non-Javadoc) * @see android.view.View#onRestoreInstanceState(android.os.Parcelable) */ @Override protected void onRestoreInstanceState(Parcelable state) { SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState()); mViewAbove.setCurrentItem(ss.getItem()); }