Example usage for android.os Bundle putSerializable

List of usage examples for android.os Bundle putSerializable

Introduction

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

Prototype

@Override
public void putSerializable(@Nullable String key, @Nullable Serializable value) 

Source Link

Document

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

Usage

From source file:Main.java

public static Bundle getSingleObjectBundle(String key, Serializable obj) {
    Bundle bundle = new Bundle();
    bundle.putSerializable(key, obj);
    return bundle;
}

From source file:Main.java

public static <T extends Serializable> Bundle putArgument(Bundle bundle, String key, T object) {
    bundle.putSerializable(key, object);
    return bundle;
}

From source file:Main.java

public static void ActivitySkipWithObject(Context context, Class<?> toClass, String key, Serializable obj) {
    Intent intent = new Intent();
    intent.setClass(context, toClass);//from   www.j a  va2 s  .co  m
    Bundle bundle = new Bundle();
    bundle.putSerializable(key, obj);
    intent.putExtras(bundle);
    //        int id =((IdObj)bundle.getSerializable("  ")).getId();
    context.startActivity(intent);
}

From source file:Main.java

public static void startActivityWithObjectForResult(Context context, Class<?> toClass, String key,
        Serializable obj, int requestCode) {
    Intent intent = new Intent();
    intent.setClass(context, toClass);/*from  ww  w  .j  av  a2s . c o m*/
    Bundle bundle = new Bundle();
    bundle.putSerializable(key, obj);
    intent.putExtras(bundle);
    //        int id =((IdObj)bundle.getSerializable("  ")).getId();
    ((Activity) context).startActivityForResult(intent, requestCode);
}

From source file:com.chatwing.whitelabel.fragments.ProfileInfoFragment.java

public static Fragment newInstance(ViewProfileEvent profile) {
    ProfileInfoFragment profileInfoFragment = new ProfileInfoFragment();
    Bundle bundle = new Bundle();
    bundle.putSerializable(PROFILE_KEY, profile);
    profileInfoFragment.setArguments(bundle);
    return profileInfoFragment;
}

From source file:com.github.rutvijkumar.twittfuse.fragments.ProfileDesciptionFragment.java

public static ProfileDesciptionFragment newInstance(User user) {
    ProfileDesciptionFragment fragment = new ProfileDesciptionFragment();
    Bundle args = new Bundle();
    args.putSerializable("EXTRA_USER_OBJ", user);
    fragment.setArguments(args);/* w  w w.j a v  a  2 s . c o m*/
    return fragment;
}

From source file:com.HumanDecisionSupportSystemsLaboratory.DD_P2P.ImageFragment.java

public static ImageFragment newInstance(byte[] imgByteArray) {
    Bundle args = new Bundle();
    args.putSerializable(EXTRA_IMAGE_BYTE_ARRAY, imgByteArray);
    ImageFragment fragment = new ImageFragment();
    fragment.setArguments(args);/*from  w  ww .j a  v a2s.c  o  m*/
    fragment.setStyle(STYLE_NO_TITLE, 0);
    return fragment;

}

From source file:codepath.watsiapp.fragments.PatientImageViewFragment.java

public static PatientImageViewFragment newInstance(String photoUrl) {
    PatientImageViewFragment fragment = new PatientImageViewFragment();
    Bundle args = new Bundle();
    args.putSerializable(PHOTO_KEY, photoUrl);
    fragment.setArguments(args);/* w  ww  . j a  va2  s  . c o  m*/
    return fragment;
}

From source file:at.bitfire.davdroid.ui.ExceptionInfoFragment.java

public static ExceptionInfoFragment newInstance(@NonNull Exception exception, Account account) {
    ExceptionInfoFragment frag = new ExceptionInfoFragment();
    Bundle args = new Bundle(1);
    args.putSerializable(ARG_EXCEPTION, exception);
    args.putParcelable(ARG_ACCOUNT, account);
    frag.setArguments(args);/*  w  ww  .ja  v a 2  s  .  c o m*/
    return frag;
}

From source file:com.dev.campus.event.EventFragment.java

public static EventFragment create(Event event) {
    EventFragment fragment = new EventFragment();
    Bundle args = new Bundle();
    args.putSerializable(ARG_EVENT_KEY, event);
    fragment.setArguments(args);//from w  ww.j  av a2  s. co  m
    return fragment;
}