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.akop.bach.fragment.playstation.TrophiesFragment.java

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

    outState.putParcelable("account", mAccount);
    outState.putLong("titleId", mTitleId);
}

From source file:com.android.mail.ui.ActionBarController.java

private void updateAccount(Account account) {
    final boolean accountChanged = mAccount == null || !mAccount.uri.equals(account.uri);
    mAccount = account;//from ww w  .  j  a v a 2 s .c o  m
    if (mAccount != null && accountChanged) {
        final ContentResolver resolver = mActivity.getActivityContext().getContentResolver();
        final Bundle bundle = new Bundle(1);
        bundle.putParcelable(UIProvider.SetCurrentAccountColumns.ACCOUNT, account);
        final UpdateProvider updater = new UpdateProvider(mAccount.uri, resolver);
        updater.execute(bundle);
        setFolderAndAccount();
    }
}

From source file:com.app.uafeed.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);
    outState.putFloat(STATE_SCROLL_PERCENTAGE, mEntryPagerAdapter.getScrollPercentage());

    super.onSaveInstanceState(outState);
}

From source file:com.bilibili.boxing.AbsBoxingViewFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    if (mCameraPicker != null) {
        mCameraPicker.onSaveInstanceState(outState);
    }//from w  w  w . ja  v a 2s  . c  o  m
    outState.putParcelable(Boxing.EXTRA_CONFIG, BoxingManager.getInstance().getBoxingConfig());
}

From source file:com.adarshahd.indianrailinfo.donate.PNRStat.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putParcelable("PSN", mPassengerDetails);
    outState.putParcelable("TRAIN", mTrainDetails);
    outState.putString("PAGE", mPageResult);
    //outState.putString("PNR",mPNRNumber);
    super.onSaveInstanceState(outState);
}

From source file:com.artemchep.horario.ui.fragments.master.AttendanceFragment.java

@Override
public void onItemClick(@NonNull View view, @NonNull Absence item) {
    super.onItemClick(view, item);
    Bundle args = new Bundle();
    args.putBoolean(ModelFragment.EXTRA_EDITABLE, mEditable);
    args.putString(ModelFragment.EXTRA_TIMETABLE_PATH, mTimetablePath);
    args.putString(AbsenceDetailsFragment.EXTRA_TIMETABLE_PATH_PUBLIC, mTimetablePathPublic);
    args.putParcelable(MooDetailsFragment.EXTRA_MODEL, item);
    Fragment fragment = new AbsenceDetailsFragment();
    fragment.setArguments(args);//  w  w w . j a va2s.co  m

    MainActivity activity = (MainActivity) getActivity();
    activity.navigateDetailsFrame(fragment);
}

From source file:com.afwsamples.testdpc.SetupManagementFragment.java

private void specifyDefaultDisclaimers(Intent intent) {
    if (BuildCompat.isAtLeastO()) {
        Bundle emmBundle = new Bundle();
        emmBundle.putString(EXTRA_PROVISIONING_DISCLAIMER_HEADER,
                getString(R.string.default_disclaimer_emm_name));
        emmBundle.putParcelable(EXTRA_PROVISIONING_DISCLAIMER_CONTENT,
                resourceToUri(getActivity(), R.raw.emm_disclaimer));
        Bundle companyBundle = new Bundle();
        companyBundle.putString(EXTRA_PROVISIONING_DISCLAIMER_HEADER,
                getString(R.string.default_disclaimer_company_name));
        companyBundle.putParcelable(EXTRA_PROVISIONING_DISCLAIMER_CONTENT,
                resourceToUri(getActivity(), R.raw.company_disclaimer));
        intent.putExtra(EXTRA_PROVISIONING_DISCLAIMERS, new Bundle[] { emmBundle, companyBundle });
    }// w  ww.ja v  a2  s  .co m
}

From source file:com.vk.sdk.dialogs.VKShareDialog.java

@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putString(SHARE_TEXT_KEY, mShareTextField.getText().toString());
    if (mAttachmentLink != null)
        outState.putParcelable(SHARE_LINK_KEY, mAttachmentLink);
    if (mAttachmentImages != null)
        outState.putParcelableArray(SHARE_IMAGES_KEY, mAttachmentImages);
    if (mExistingPhotos != null)
        outState.putParcelable(SHARE_UPLOADED_IMAGES_KEY, mExistingPhotos);
}

From source file:Main.java

@SuppressWarnings("unchecked")
private static void putArray(String key, ArrayList arrayList, Bundle bundle) {
    if (arrayList.size() == 0) {
        bundle.putBooleanArray(key, new boolean[] {});
    } else {// w w  w  . j av a 2  s . c  o  m
        verifyArrayListIsSingleType(arrayList);
        if (arrayList.get(0) instanceof String) {
            bundle.putStringArray(key, toStringArray((ArrayList<String>) arrayList));
        } else if (arrayList.get(0) instanceof Integer) {
            bundle.putIntArray(key, toIntArray((ArrayList<Integer>) arrayList));
        } else if (arrayList.get(0) instanceof Float) {
            bundle.putFloatArray(key, toFloatArray((ArrayList<Float>) arrayList));
        } else if (arrayList.get(0) instanceof Double) {
            bundle.putDoubleArray(key, toDoubleArray((ArrayList<Double>) arrayList));
        } else if (arrayList.get(0) instanceof Boolean) {
            bundle.putBooleanArray(key, toBooleanArray((ArrayList<Boolean>) arrayList));
        } else if (arrayList.get(0) instanceof HashMap) {
            bundle.putParcelableArray(key, toBundleArray((ArrayList<HashMap>) arrayList));
        } else if (arrayList.get(0) instanceof ArrayList) {
            Log.w("RNNavigation",
                    "Arrays of arrays passed in props are converted to dictionaries with indexes as keys");
            Bundle innerArray = new Bundle();
            for (int i = 0; i < arrayList.size(); i++) {
                putArray(String.valueOf(i), (ArrayList) arrayList.get(i), innerArray);
            }
            bundle.putParcelable(key, innerArray);
        }
    }
}

From source file:com.antew.redditinpictures.library.ui.ImageViewerFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    if (mImage != null) {
        outState.putParcelable(IMAGE_DATA_EXTRA, mImage);
    }/* w w w .j  a va  2s. c  om*/

    if (mAlbum != null) {
        outState.putParcelable(IMAGE_ALBUM_EXTRA, mAlbum);
    }

    super.onSaveInstanceState(outState);
}