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:com.google.reviewit.ServerSettingsFragment.java

public static ServerSettingsFragment create(Class<? extends Fragment> origin) {
    ServerSettingsFragment fragment = new ServerSettingsFragment();
    Bundle bundle = new Bundle();
    bundle.putSerializable(ORIGIN, origin);
    fragment.setArguments(bundle);//  w w  w  . java2s . com
    return fragment;
}

From source file:com.google.reviewit.ServerSettingsFragment.java

public static ServerSettingsFragment create(Class<? extends Fragment> origin, String serverId) {
    ServerSettingsFragment fragment = new ServerSettingsFragment();
    Bundle bundle = new Bundle();
    bundle.putSerializable(ORIGIN, origin);
    bundle.putString(SERVER_ID, serverId);
    fragment.setArguments(bundle);//w  w w .ja v a 2 s  . c om
    return fragment;
}

From source file:com.feathercoin.wallet.feathercoin.ui.TransactionsListFragment.java

public static TransactionsListFragment instance(final Direction direction) {
    final TransactionsListFragment fragment = new TransactionsListFragment();

    final Bundle args = new Bundle();
    args.putSerializable(KEY_DIRECTION, direction);
    fragment.setArguments(args);/*  w  w w  .j av  a2  s  .c om*/

    return fragment;
}

From source file:com.amazon.android.ui.fragments.ErrorDialogFragment.java

/**
 * Creates a new instance of the dialog fragment.
 *
 * @param context                     The relevant context.
 * @param errorCategory               To help determine the error specific parameters.
 * @param errorDialogFragmentListener The fragment listener.
 * @return The ErrorDialogFragment instance.
 *//*from w  w  w .  ja  va2  s. co  m*/
public static ErrorDialogFragment newInstance(Context context, ErrorUtils.ERROR_CATEGORY errorCategory,
        ErrorDialogFragmentListener errorDialogFragmentListener) {

    ErrorDialogFragment errorDialogFragment = new ErrorDialogFragment();
    errorDialogFragment.mListener = errorDialogFragmentListener;
    errorDialogFragment.setStyle(DialogFragment.STYLE_NO_TITLE, R.style.error_dialog);
    // Setting it as non-cancelable prevents back button press issues.
    errorDialogFragment.setCancelable(false);
    Bundle args = new Bundle();
    // Set the error category.
    args.putSerializable(ARG_ERROR_CATEGORY, errorCategory);
    // Get the error message.
    args.putString(ARG_ERROR_MESSAGE, ErrorUtils.getErrorMessage(context, errorCategory));
    // Get the button details.
    args.putStringArrayList(ARG_ACTION_LABELS,
            (ArrayList<String>) ErrorUtils.getButtonLabelsList(context, errorCategory));
    // Get the button behavior.
    errorDialogFragment.setArguments(args);
    return errorDialogFragment;
}

From source file:com.misczak.joinmybridge.BridgeFragment.java

public static BridgeFragment newInstance(UUID bridgeId, String bridgeName, String bridgeNumber,
        String participantCode, String hostCode, String firstTone, String secondTone) {
    Bundle args = new Bundle();
    args.putSerializable(EXTRA_BRIDGE_ID, bridgeId);
    args.putSerializable(EXTRA_BRIDGE_NAME, bridgeName);
    args.putSerializable(EXTRA_BRIDGE_NUMBER, bridgeNumber);
    args.putSerializable(EXTRA_PARTICIPANT_CODE, participantCode);
    args.putSerializable(EXTRA_HOST_CODE, hostCode);
    args.putSerializable(EXTRA_FIRST_TONE, firstTone);
    args.putSerializable(EXTRA_SECOND_TONE, secondTone);

    BridgeFragment fragment = new BridgeFragment();
    fragment.setArguments(args);//from w  w w  . ja va 2  s . c o  m

    return fragment;
}

From source file:com.example.com.benasque2014.mercurio.FamiliaMapaFragment.java

public static FamiliaMapaFragment create(Recorrido r) {
    FamiliaMapaFragment fragment = new FamiliaMapaFragment();
    Bundle b = new Bundle();
    b.putSerializable(Recorrido.KEY, r);
    fragment.setArguments(b);/*w  w  w  . j  av  a  2s .  c  o m*/
    return fragment;

}

From source file:com.auth0.lock.fragment.SignUpFormFragment.java

public static SignUpFormFragment newFragment(boolean useEmail, boolean loginAfterSignUp,
        Map<String, Object> parameters) {
    Bundle arguments = new Bundle();
    arguments.putBoolean(USE_EMAIL_SIGNUP_ARGUMENT, useEmail);
    arguments.putBoolean(LOGIN_AFTER_SIGNUP_ARGUMENT, loginAfterSignUp);
    arguments.putSerializable(AUTHENTICATION_PARAMETER_ARGUMENT, (java.io.Serializable) parameters);
    SignUpFormFragment fragment = new SignUpFormFragment();
    fragment.setArguments(arguments);//from  ww w.  j  av a  2 s . c o m
    return fragment;
}

From source file:com.microsoft.rightsmanagement.sampleapp.TextEditorFragment.java

/**
 * New instance.//from w w w.  ja  v  a  2  s  .co m
 * 
 * @param textEditorMode the text editor mode
 * @return the text editor fragment
 */
public static TextEditorFragment newInstance(TextEditorMode textEditorMode, UserPolicy userPolicy) {
    TextEditorFragment fragment = new TextEditorFragment();
    Bundle args = new Bundle();
    if (textEditorMode != null) {
        args.putInt(KEY_EDITOR_MODE, textEditorMode.ordinal());
    }
    if (userPolicy != null) {
        args.putSerializable(KEY_USER_POLICY, userPolicy);
    }
    fragment.setArguments(args);
    return fragment;
}

From source file:com.duy.pascal.ui.file.fragment.FileListPagerFragment.java

public static Fragment newFragment(File path) {
    DLog.d(TAG, "newFragment() called with: path = [" + path + "]");

    FileListPagerFragment f = new FileListPagerFragment();
    Bundle b = new Bundle();
    b.putSerializable("path", path);
    f.setArguments(b);/*from   w  ww .j  a va 2s. c  o m*/
    return f;
}

From source file:ca.rmen.android.scrumchatter.dialog.DialogFragmentFactory.java

/**
 * @param inputValidatorClass will be called with each text event on the edit text, to validate the user's input.
 *//*from w  ww.java2s  . c  o m*/
public static void showInputDialog(FragmentActivity activity, String title, String inputHint,
        String prefilledText, Class<?> inputValidatorClass, int actionId, Bundle extras) {
    Log.v(TAG, "showInputDialog: title = " + title + ", prefilledText =  " + prefilledText + ", actionId = "
            + actionId + ", extras = " + extras);
    Bundle arguments = new Bundle(6);
    arguments.putString(EXTRA_TITLE, title);
    arguments.putString(EXTRA_INPUT_HINT, inputHint);
    arguments.putInt(EXTRA_ACTION_ID, actionId);
    arguments.putString(EXTRA_ENTERED_TEXT, prefilledText);
    if (inputValidatorClass != null)
        arguments.putSerializable(EXTRA_INPUT_VALIDATOR_CLASS, inputValidatorClass);
    arguments.putBundle(EXTRA_EXTRAS, extras);
    InputDialogFragment result = new InputDialogFragment();
    result.setArguments(arguments);
    result.show(activity.getSupportFragmentManager(), InputDialogFragment.class.getSimpleName());
}