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:org.klnusbaum.udj.auth.Authenticator.java

@Override
public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType,
        String[] requiredFeatures, Bundle options) {
    final Intent addIntent = new Intent(context, AuthActivity.class);
    addIntent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
    final Bundle addBundle = new Bundle();
    addBundle.putParcelable(AccountManager.KEY_INTENT, addIntent);
    return addBundle;
}

From source file:com.actinarium.kinetic.ui.MainActivity.java

@Override
protected void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelable(ARG_ACCEL, mAccelData);
    outState.putParcelable(ARG_GYRO, mGyroData);
    outState.putParcelable(ARG_RV, mRotVectorData);
    outState.putBooleanArray(ARG_RHS, mResultHoldersState);
    outState.putIntArray(ARG_HAM, mHolderToAnimatorMap);
}

From source file:com.android.design.parallax.views.adapters.CacheFragmentStatePagerAdapter.java

public Parcelable saveState() {
    final Parcelable p = super.saveState();
    final Bundle bundle = new Bundle();
    bundle.putParcelable(STATE_SUPER_STATE, p);
    bundle.putInt(STATE_PAGES, mPages.size());
    if (0 < mPages.size()) {
        for (int i = 0; i < mPages.size(); i++) {
            int position = mPages.keyAt(i);
            bundle.putInt(createCacheIndex(i), position);
            Fragment f = mPages.get(position);
            mFm.putFragment(bundle, createCacheKey(position), f);
        }/*from  w ww .  jav a 2  s  . c  o m*/
    }
    return bundle;
}

From source file:cn.arvin.example.ui.custom.observablescrollview.CacheFragmentStatePagerAdapter.java

@Override
public Parcelable saveState() {
    Parcelable p = super.saveState();
    Bundle bundle = new Bundle();
    bundle.putParcelable(STATE_SUPER_STATE, p);

    bundle.putInt(STATE_PAGES, mPages.size());
    if (0 < mPages.size()) {
        for (int i = 0; i < mPages.size(); i++) {
            int position = mPages.keyAt(i);
            bundle.putInt(createCacheIndex(i), position);
            Fragment f = mPages.get(position);
            mFm.putFragment(bundle, createCacheKey(position), f);
        }/*from   ww w  .ja v a 2 s  . co m*/
    }
    return bundle;
}

From source file:com.clearcenter.mobile_demo.mdAuthenticator.java

public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType,
        String[] requiredFeatures, Bundle options) {
    Log.v(TAG, "addAccount()");
    final Intent intent = new Intent(ctx, mdAuthenticatorActivity.class);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}

From source file:com.clearcenter.mobile_demo.mdAuthenticator.java

public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) {
    Log.v(TAG, "confirmCredentials()");
    //return null;
    final Intent intent = new Intent(ctx, mdAuthenticatorActivity.class);
    intent.putExtra(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE, response);
    final Bundle bundle = new Bundle();
    bundle.putParcelable(AccountManager.KEY_INTENT, intent);
    return bundle;
}

From source file:com.coinpany.core.android.widget.observablescrollview.CacheFragmentStatePagerAdapter.java

@Override
public Parcelable saveState() {
    Parcelable p = super.saveState();
    Bundle bundle = new Bundle();
    bundle.putParcelable(STATE_SUPER_STATE, p);

    bundle.putInt(STATE_PAGES, mPages.size());
    if (0 < mPages.size()) {
        for (int i = 0; i < mPages.size(); i++) {
            int position = mPages.keyAt(i);
            bundle.putInt(createCacheIndex(i), position);
            Fragment f = mPages.get(position);
            if (f.isAdded()) {
                mFm.putFragment(bundle, createCacheKey(position), f);
            }/*  w ww .j a  v  a2s. co  m*/
        }
    }
    return bundle;
}

From source file:com.commonsware.cwac.colormixer.ColorMixer.java

@Override
public Parcelable onSaveInstanceState() {
    Bundle state = new Bundle();

    state.putParcelable(SUPERSTATE, super.onSaveInstanceState());
    state.putInt(COLOR, getColor());/*w w w. j av a  2 s.c o  m*/

    return (state);
}

From source file:com.chromium.fontinstaller.ui.install.PreviewFragment.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    super.onSaveInstanceState(savedInstanceState);
    savedInstanceState.putParcelable(STATE_FONT_PACKAGE, fontPackage);
    savedInstanceState.putParcelable(STATE_FONT_STYLE, style);
    savedInstanceState.putBoolean(STATE_UPPER_CASE, upperCase);
}