use of android.os.Parcelable in project Libraries-for-Android-Developers by eoecn.
the class ActionBarView method onSaveInstanceState.
@Override
public Parcelable onSaveInstanceState() {
Parcelable superState = super.onSaveInstanceState();
SavedState state = new SavedState(superState);
if (mExpandedMenuPresenter != null && mExpandedMenuPresenter.mCurrentExpandedItem != null) {
state.expandedMenuItemId = mExpandedMenuPresenter.mCurrentExpandedItem.getItemId();
}
state.isOverflowOpen = isOverflowMenuShowing();
return state;
}
use of android.os.Parcelable in project Libraries-for-Android-Developers by eoecn.
the class MenuBuilder method dispatchSaveInstanceState.
private void dispatchSaveInstanceState(Bundle outState) {
if (mPresenters.isEmpty())
return;
SparseArray<Parcelable> presenterStates = new SparseArray<Parcelable>();
for (WeakReference<MenuPresenter> ref : mPresenters) {
final MenuPresenter presenter = ref.get();
if (presenter == null) {
mPresenters.remove(ref);
} else {
final int id = presenter.getId();
if (id > 0) {
final Parcelable state = presenter.onSaveInstanceState();
if (state != null) {
presenterStates.put(id, state);
}
}
}
}
outState.putSparseParcelableArray(PRESENTER_KEY, presenterStates);
}
use of android.os.Parcelable in project Libraries-for-Android-Developers by eoecn.
the class IcsAbsSpinner method onSaveInstanceState.
@Override
public Parcelable onSaveInstanceState() {
Parcelable superState = super.onSaveInstanceState();
SavedState ss = new SavedState(superState);
ss.selectedId = getSelectedItemId();
if (ss.selectedId >= 0) {
ss.position = getSelectedItemPosition();
} else {
ss.position = INVALID_POSITION;
}
return ss;
}
use of android.os.Parcelable in project android-app by eoecn.
the class TitlePageIndicator method onSaveInstanceState.
@Override
public Parcelable onSaveInstanceState() {
Parcelable superState = super.onSaveInstanceState();
SavedState savedState = new SavedState(superState);
savedState.currentPage = mCurrentPage;
return savedState;
}
use of android.os.Parcelable in project android-app by eoecn.
the class SlidingMenu method onSaveInstanceState.
/* (non-Javadoc)
* @see android.view.View#onSaveInstanceState()
*/
@Override
protected Parcelable onSaveInstanceState() {
Parcelable superState = super.onSaveInstanceState();
SavedState ss = new SavedState(superState, mViewAbove.getCurrentItem());
return ss;
}
Aggregations