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:Main.java

public static Parcelable cloneParcelbleClass(@NonNull Parcelable orange) {
    Bundle bundle = new Bundle();
    bundle.putParcelable("clone", orange);
    return bundle.getParcelable("clone");
}

From source file:Main.java

public static Message createMessage(int What, Parcelable parcelable) {
    Message message = new Message();
    message.what = What;/*  w w w .  j a va 2 s.  com*/
    Bundle data = new Bundle();
    data.putParcelable(ARG_PARCELABLE, parcelable);
    message.setData(data);
    return message;
}

From source file:Main.java

public static Bundle createBundle(final String key, final Parcelable value) {
    final Bundle bundle = new Bundle();
    bundle.putParcelable(key, value);
    return bundle;
}

From source file:Main.java

public static Bundle toBundle(Map<String, ? extends Parcelable> input) {
    Bundle output = new Bundle();
    for (String key : input.keySet()) {
        output.putParcelable(key, input.get(key));
    }//from   w w w. j a v a 2s  .  c  o  m
    return output;
}

From source file:com.wellsandwhistles.android.redditsp.fragments.CommentPropertiesDialog.java

public static CommentPropertiesDialog newInstance(final RedditComment comment) {

    final CommentPropertiesDialog pp = new CommentPropertiesDialog();

    final Bundle args = new Bundle();
    args.putParcelable("comment", comment);
    pp.setArguments(args);//from   w  ww . j  a v  a 2s  .  c  o  m

    return pp;
}

From source file:cn.com.mark.multiimage.core.ImageDetailFragment.java

public static ImageDetailFragment newInstance(ImageEntity imageUrl) {
    final ImageDetailFragment f = new ImageDetailFragment();

    final Bundle args = new Bundle();
    args.putParcelable("data-image", imageUrl);
    f.setArguments(args);//w ww  .  j  a v a  2 s  .  c o m
    return f;
}

From source file:com.ryan.ryanreader.fragments.PostPropertiesDialog.java

public static PostPropertiesDialog newInstance(final RedditPost post) {

    final PostPropertiesDialog pp = new PostPropertiesDialog();

    final Bundle args = new Bundle();
    args.putParcelable("post", post);
    pp.setArguments(args);/*from  ww w . j av a2  s .  c  om*/

    return pp;
}

From source file:com.afg.MngProductContentProvider.Fragments.ManageCategory_Fragment.java

public static ManageCategory_Fragment newInstance(Category category, int mode) {

    Bundle args = new Bundle();
    args.putParcelable(ListCategory_Fragment.RECOVERY_CATEGORY, category);
    args.putInt(ListCategory_Fragment.RECOVERY_MODE_OPEN, mode);
    ManageCategory_Fragment fragment = new ManageCategory_Fragment();
    fragment.setArguments(args);//from   w w w.  j  a v a2  s  .c  om
    return fragment;
}

From source file:com.albedinsky.android.ui.examples.fragment.animation.TransitionFragmentsA.java

public static Bundle argsWithTransitionExample(TransitionExample example) {
    final Bundle args = new Bundle();
    args.putParcelable(Extras.EXTRA_TRANSITION_EXAMPLE, example);
    return args;/*from   ww w . j  a  v  a2s  .co m*/
}

From source file:cc.mintcoin.wallet.util.BitmapFragment.java

private static BitmapFragment instance(@Nonnull final Bitmap bitmap) {
    final BitmapFragment fragment = new BitmapFragment();

    final Bundle args = new Bundle();
    args.putParcelable(KEY_BITMAP, bitmap);
    fragment.setArguments(args);/*w w w. j av  a  2 s .  c om*/

    return fragment;
}