Example usage for android.os Bundle putParcelable

List of usage examples for android.os Bundle putParcelable

Introduction

In this page you can find the example usage for android.os Bundle putParcelable.

Prototype

public void putParcelable(@Nullable String key, @Nullable Parcelable value) 

Source Link

Document

Inserts a Parcelable value into the mapping of this Bundle, replacing any existing value for the given key.

Usage

From source file:com.richtodd.android.quiltdesign.app.BlockEditActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);

    outState.putString("saveAsBlockName", m_saveAsBlockName);
    outState.putParcelable("theme", m_theme);
}

From source file:com.zzisoo.toylibrary.fragment.ToyListViewFragment.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    // Save currently selected layout manager.
    savedInstanceState.putSerializable(KEY_LAYOUT_MANAGER, mLayoutType);
    super.onSaveInstanceState(savedInstanceState);

    super.onSaveInstanceState(savedInstanceState);
    savedInstanceState.putParcelable(BUNDLE_RECYCLER_LAYOUT,
            mToyListView.getLayoutManager().onSaveInstanceState());

}

From source file:com.samsung.spen.SpenPlugin.java

@Override
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);
    if (Log.isLoggable(Utils.SPEN, Log.DEBUG)) {
        Log.d(TAG, "Inside onActivityResult");
        Log.d(TAG, "Intent: " + intent + ", requestCode: " + requestCode);
    }/*from  www  .j  a  va 2  s . com*/
    if (requestCode == Utils.REQUEST_CODE_SELECT_IMAGE_BACKGROUND) {
        if (Log.isLoggable(Utils.SPEN, Log.DEBUG)) {
            Log.d(TAG, "on background image selected");
        }
        if (mCurrentSurfaceType == Utils.SURFACE_INLINE) {
            mSpenSurfaceViews.getSurfaceView(mCurrentWorkingId).setasBgImage(intent);
        } else {
            Message msgObj = setBgHandler.obtainMessage();
            Bundle b = new Bundle();
            b.putParcelable("intent", intent);
            msgObj.setData(b);
            setBgHandler.sendMessage(msgObj);
        }
    } else {
        if (Log.isLoggable(Utils.SPEN, Log.DEBUG)) {
            Log.d(TAG, "request code is not matching");
        }
    }
}

From source file:com.orbar.pxdemo.MainActivity.java

protected void openMyAccount() {

    // remove selected item and update title, then close the drawer
    mDrawerCategoryList.clearChoices();//from   w w  w.  j ava  2s. c o  m
    mDrawerCategoryList.requestLayout();

    setTitle(R.string.my_account);

    mDrawerLayout.closeDrawer(mDrawerView);

    fragment = new MyAccount2Fragment();

    Bundle args = new Bundle();

    args.putParcelable(MyAccount2Fragment.ARG_USER_BEAN, mFiveZeroZeroUserBean);
    args.putParcelable(MyAccount2Fragment.ARG_IMAGE_BEAN, mFiveZeroZeroImageBean);

    fragment.setArguments(args);

    FragmentManager fragmentManager = getFragmentManager();

    fragmentManager.beginTransaction().replace(R.id.content_frame, fragment).addToBackStack(null).commit();

}

From source file:com.hybris.mobile.app.commerce.fragment.CatalogContentFragmentBase.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putParcelable(SAVED_INSTANCE_CATEGORY, mCurrentCategory);
    outState.putString(SAVED_INSTANCE_SEARCH_TEXT, mCurrentSearchText);
    super.onSaveInstanceState(outState);
}

From source file:com.chute.android.photopickerplus.ui.activity.ServicesActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString(Constants.KEY_FOLDER_ID, folderId);
    outState.putParcelable(Constants.KEY_ACCOUNT, account);
    outState.putInt(Constants.KEY_PHOTO_FILTER_TYPE, photoFilterType);
    List<Integer> accountPositions = new ArrayList<Integer>();
    List<Integer> imagePaths = new ArrayList<Integer>();
    List<Integer> videoPaths = new ArrayList<Integer>();
    if (listenerAssetsSelection != null && listenerAssetsSelection.getSocialPhotosSelection() != null) {
        accountPositions.addAll(listenerAssetsSelection.getSocialPhotosSelection());
        outState.putIntegerArrayList(Constants.KEY_SELECTED_ACCOUNTS_ITEMS,
                (ArrayList<Integer>) accountPositions);
    }//from w  ww.  j  ava2s. c om
    if (listenerImagesSelection != null && listenerImagesSelection.getCursorImagesSelection() != null) {
        imagePaths.addAll(listenerImagesSelection.getCursorImagesSelection());
        outState.putIntegerArrayList(Constants.KEY_SELECTED_IMAGES_ITEMS, (ArrayList<Integer>) imagePaths);
    }
    if (listenerVideosSelection != null && listenerVideosSelection.getCursorVideosSelection() != null) {
        videoPaths.addAll(listenerVideosSelection.getCursorVideosSelection());
        outState.putIntegerArrayList(Constants.KEY_SELECTED_VIDEOS_ITEMS, (ArrayList<Integer>) videoPaths);
    }

}

From source file:it.scoppelletti.mobilepower.widget.DateControl.java

protected void onSaveInstanceState(Bundle outState) {
    if (!StringUtils.isBlank(myDialogTag)) {
        outState.putString(DateControl.STATE_DIALOGTAG, myDialogTag);
    }//from   www .  j  a va  2  s.  co  m
    if (myIsEmptyAllowed) {
        outState.putBoolean(DateControl.STATE_ISEMPTYALLOWED, true);
    }
    if (myIsResetEnabled) {
        outState.putBoolean(DateControl.STATE_ISRESETENABLED, true);
    }
    if (!ValueTools.isNullOrEmpty(myValue)) {
        outState.putParcelable(DateControl.STATE_VALUE, myValue);
    }
    if (myValueControl.getError() != null) {
        outState.putCharSequence(DateControl.STATE_ERROR, myValueControl.getError());
    }
}

From source file:bottombar.BottomBarTab.java

@Override
public Parcelable onSaveInstanceState() {
    if (badge != null) {
        Bundle bundle = saveState();
        bundle.putParcelable("superstate", super.onSaveInstanceState());

        return bundle;
    }/*from  w w  w. ja  v  a 2s . c o m*/

    return super.onSaveInstanceState();
}

From source file:com.carlrice.reader.fragment.EntryFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putParcelable(STATE_BASE_URI, mBaseUri);
    outState.putLongArray(STATE_ENTRIES_IDS, mEntriesIds);
    outState.putLong(STATE_INITIAL_ENTRY_ID, mInitialEntryId);
    outState.putInt(STATE_CURRENT_PAGER_POS, mCurrentPagerPos);

    super.onSaveInstanceState(outState);
}

From source file:com.notalenthack.blaster.CommandActivity.java

@Override
protected void onSaveInstanceState(Bundle savedInstanceState) {
    if (mDevice != null) {
        savedInstanceState.putParcelable(Constants.KEY_DEVICE_STATE, mDevice);
    }/*from  ww w.  j av a  2  s  .c o  m*/
    super.onSaveInstanceState(savedInstanceState);
}