Example usage for android.os Bundle putCharSequence

List of usage examples for android.os Bundle putCharSequence

Introduction

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

Prototype

@Override
public void putCharSequence(@Nullable String key, @Nullable CharSequence value) 

Source Link

Document

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

Usage

From source file:de.uni.stuttgart.informatik.ToureNPlaner.UI.Dialogs.TextDialog.java

public static TextDialog newInstance(TextDialog dialog, String title, String content) {
    Bundle b = new Bundle();
    b.putString("title", title);
    b.putCharSequence("content", content);
    dialog.setArguments(b);/*from w w w . j av a  2 s .com*/
    return dialog;
}

From source file:org.andstatus.app.util.DialogFactory.java

/** See http://stackoverflow.com/questions/10285047/showdialog-deprecated-whats-the-alternative */
public static void showOkDialog(Fragment fragment, int titleId, int messageId, final int requestCode) {
    DialogFragment dialog = new OkDialogFragment();
    Bundle args = new Bundle();
    args.putCharSequence(DIALOG_TITLE_KEY, fragment.getText(titleId));
    args.putCharSequence(DIALOG_MESSAGE_KEY, fragment.getText(messageId));
    dialog.setArguments(args);/*from  w  w  w  .ja va 2  s.  c o  m*/
    dialog.setTargetFragment(fragment, requestCode);
    dialog.show(fragment.getFragmentManager(), OK_DIALOG_TAG);
}

From source file:org.andstatus.app.util.DialogFactory.java

public static void showYesCancelDialog(Fragment fragment, int titleId, int messageId,
        final ActivityRequestCode requestCode) {
    DialogFragment dialog = new YesCancelDialog();
    Bundle args = new Bundle();
    args.putCharSequence(DIALOG_TITLE_KEY, fragment.getText(titleId));
    args.putCharSequence(DIALOG_MESSAGE_KEY, fragment.getText(messageId));
    dialog.setArguments(args);/*from  w ww . j av a2s .  com*/
    dialog.setTargetFragment(fragment, requestCode.id);
    dialog.show(fragment.getFragmentManager(), YES_CANCEL_DIALOG_TAG);
}

From source file:siarhei.luskanau.gps.tracker.free.ui.progress.ProgressDialogFragment.java

private static ProgressDialogFragment newInstance(CharSequence title, CharSequence message, String action) {
    ProgressDialogFragment fragment = new ProgressDialogFragment();
    Bundle args = new Bundle();
    args.putCharSequence(TITLE_ARG, title);
    args.putCharSequence(MESSAGE_ARG, message);
    args.putString(REFRESH_ACTION_ARG, action);
    fragment.setArguments(args);//  w  w  w  . ja  va2s . c o  m
    return fragment;
}

From source file:org.totschnig.myexpenses.dialog.MessageDialogFragment.java

public static final MessageDialogFragment newInstance(int title, CharSequence message, Button positive,
        Button neutral, Button negative) {
    MessageDialogFragment dialogFragment = new MessageDialogFragment();
    Bundle bundle = new Bundle();
    bundle.putInt("title", title);
    bundle.putCharSequence("message", message);
    bundle.putSerializable("positive", positive);
    bundle.putSerializable("neutral", neutral);
    bundle.putSerializable("negative", negative);
    dialogFragment.setArguments(bundle);
    return dialogFragment;
}

From source file:edu.mit.mobile.android.livingpostcards.DeleteDialogFragment.java

public static DeleteDialogFragment newInstance(Uri item, CharSequence title, CharSequence message) {
    final DeleteDialogFragment f = new DeleteDialogFragment();
    final Bundle args = new Bundle();
    args.putParcelable(ARG_ITEM_URI, item);
    args.putCharSequence(ARG_TITLE, title);
    args.putCharSequence(ARG_MESSAGE, message);
    f.setArguments(args);//from  ww w . j av  a  2 s . c  o  m
    return f;
}

From source file:pylapp.smoothclicker.android.views.MyAppIntroFragment.java

/**
 *
 * @param title -/*  www.j av  a2 s .  c  o  m*/
 * @param description -
 * @param imageDrawable -
 * @param bgColor -
 * @param titleColor -
 * @param descColor -
 * @return MyAppIntroFragment -
 */
public static MyAppIntroFragment newInstance(CharSequence title, CharSequence description, int imageDrawable,
        int bgColor, int titleColor, int descColor) {

    MyAppIntroFragment sampleSlide = new MyAppIntroFragment();

    Bundle args = new Bundle();
    args.putCharSequence(ARG_TITLE, title);
    args.putCharSequence(ARG_DESC, description);
    args.putInt(ARG_DRAWABLE, imageDrawable);
    args.putInt(ARG_BG_COLOR, bgColor);
    args.putInt(ARG_TITLE_COLOR, titleColor);
    args.putInt(ARG_DESC_COLOR, descColor);
    sampleSlide.setArguments(args);

    return sampleSlide;

}

From source file:org.hopestarter.wallet.util.BitmapFragment.java

private static BitmapFragment instance(final Bitmap bitmap, @Nullable final Spanned label,
        @Nullable final CharSequence address) {
    final BitmapFragment fragment = new BitmapFragment();

    final Bundle args = new Bundle();
    args.putParcelable(KEY_BITMAP, bitmap);
    if (label != null)
        args.putCharSequence(KEY_LABEL, Html.toHtml(label));
    if (address != null)
        args.putCharSequence(KEY_ADDRESS, address);
    fragment.setArguments(args);/*from  w  ww  . j  a  va 2 s  .com*/

    return fragment;
}

From source file:com.google.android.apps.mytracks.fragments.ConfirmDialogFragment.java

public static ConfirmDialogFragment newInstance(int confirmId, boolean defaultValue, CharSequence message,
        long trackId) {
    Bundle bundle = new Bundle();
    bundle.putInt(KEY_CONFIRM_ID, confirmId);
    bundle.putBoolean(KEY_DEFAULT_VALUE, defaultValue);
    bundle.putCharSequence(KEY_MESSAGE, message);
    bundle.putLong(KEY_TRACK_ID, trackId);

    ConfirmDialogFragment confirmDialogFragment = new ConfirmDialogFragment();
    confirmDialogFragment.setArguments(bundle);
    return confirmDialogFragment;
}

From source file:org.rm3l.ddwrt.tiles.admin.nvram.EditNVRAMKeyValueDialogFragment.java

@NotNull
public static EditNVRAMKeyValueDialogFragment newInstance(
        NVRAMDataRecyclerViewAdapter nvramDataRecyclerViewAdapter, int position, CharSequence key,
        CharSequence value) {/*from   w ww .  j  a v a2  s .co  m*/
    final EditNVRAMKeyValueDialogFragment fragment = new EditNVRAMKeyValueDialogFragment();

    fragment.nvramDataRecyclerViewAdapter = nvramDataRecyclerViewAdapter;

    final Bundle args = new Bundle();
    args.putInt(POSITION, position);
    args.putCharSequence(KEY, key);
    args.putCharSequence(VALUE, value);
    fragment.setArguments(args);

    return fragment;
}