Example usage for android.os Bundle putStringArray

List of usage examples for android.os Bundle putStringArray

Introduction

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

Prototype

public void putStringArray(@Nullable String key, @Nullable String[] value) 

Source Link

Document

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

Usage

From source file:com.ultramegasoft.flavordex2.fragment.EntryListFragment.java

/**
 * Get an instance of this Fragment.//w  w  w  .  j a  v  a  2 s  .c  o  m
 *
 * @param catId        The category ID
 * @param twoPane      Whether the layout is in two-pane mode
 * @param selectedItem The selected item ID
 * @param exportMode   Whether to enable export mode
 * @param where        The where clause
 * @param whereArgs    The values for the parameters of the where clause
 * @return An instance of this Fragment
 */
@NonNull
public static EntryListFragment getInstance(long catId, boolean twoPane, long selectedItem, boolean exportMode,
        @Nullable String where, @Nullable String[] whereArgs) {
    final EntryListFragment fragment = new EntryListFragment();
    final Bundle args = new Bundle();
    args.putLong(ARG_CAT, catId);
    args.putBoolean(ARG_TWO_PANE, twoPane);
    args.putLong(ARG_SELECTED_ITEM, selectedItem);
    args.putBoolean(ARG_EXPORT_MODE, exportMode);
    args.putString(ARG_WHERE, where);
    args.putStringArray(ARG_WHERE_ARGS, whereArgs);
    fragment.setArguments(args);
    return fragment;
}

From source file:com.ruesga.rview.fragments.EditFileChooserDialogFragment.java

public static EditFileChooserDialogFragment newRenameInstance(Context context, int requestCode,
        int legacyChangeId, String revisionId, String source, String[] prevFiles, View anchor) {
    EditFileChooserDialogFragment fragment = new EditFileChooserDialogFragment();
    Bundle arguments = new Bundle();
    arguments.putInt(Constants.EXTRA_LEGACY_CHANGE_ID, legacyChangeId);
    arguments.putString(Constants.EXTRA_REVISION_ID, revisionId);
    arguments.putString(EXTRA_MODE, MODE.RENAME.name());
    arguments.putInt(EXTRA_TITLE, R.string.edit_file_rename);
    arguments.putInt(EXTRA_ACTION, R.string.action_rename);
    arguments.putString(EXTRA_HINT_1, context.getString(R.string.edit_file_rename_old_hint));
    arguments.putString(EXTRA_HINT_2, context.getString(R.string.edit_file_rename_new_hint));
    arguments.putString(EXTRA_VALUE, source);
    arguments.putParcelable(EXTRA_ANCHOR, computeViewOnScreen(anchor));
    arguments.putInt(EXTRA_REQUEST_CODE, requestCode);
    if (prevFiles != null) {
        arguments.putStringArray(EXTRA_PREV_FILES, prevFiles);
    }//  w  ww.  ja  v  a  2s.  c  o  m
    fragment.setArguments(arguments);
    return fragment;
}

From source file:at.wada811.android.dialogfragments.sample.alertdialogfragment.examples.ItemsAlertDialogExample.java

@Override
public void showDialog(DialogFragmentCallbackProvider provider, FragmentManager fragmentManager) {
    String[] items = new String[] { AlertDialog.class.getSimpleName(),
            CharacterPickerDialog.class.getSimpleName(), ProgressDialog.class.getSimpleName(),
            DatePickerDialog.class.getSimpleName(), TimePickerDialog.class.getSimpleName(), };
    Bundle extra = new Bundle();
    extra.putStringArray("items", items);
    new AlertDialogFragment.Builder(context).setIcon(R.drawable.ic_launcher).setTitle(R.string.dialog_title)
            .setItems(items).setExtra(extra).setNegativeButton(R.string.dialog_cancel, null)
            .show(fragmentManager, label);
}

From source file:at.wada811.android.dialogfragments.sample.alertdialogfragment.examples.SingleChoiceAlertDialogExample.java

@Override
public void showDialog(DialogFragmentCallbackProvider provider, FragmentManager fragmentManager) {
    String[] items = new String[] { AlertDialog.class.getSimpleName(),
            CharacterPickerDialog.class.getSimpleName(), ProgressDialog.class.getSimpleName(),
            DatePickerDialog.class.getSimpleName(), TimePickerDialog.class.getSimpleName(), };
    Bundle extra = new Bundle();
    extra.putStringArray("items", items);
    new AlertDialogFragment.Builder(context).setIcon(R.drawable.ic_launcher).setTitle(R.string.dialog_title)
            .setSingleChoiceItems(items, 3).setExtra(extra).setPositiveButton(R.string.dialog_ok, null)
            .setNegativeButton(R.string.dialog_cancel, null).show(fragmentManager, label);
}

From source file:at.wada811.android.dialogfragments.sample.alertdialogfragment.examples.MultiChoiceAlertDialogExample.java

@Override
public void showDialog(DialogFragmentCallbackProvider provider, FragmentManager fragmentManager) {
    String[] items = new String[] { AlertDialog.class.getSimpleName(),
            CharacterPickerDialog.class.getSimpleName(), ProgressDialog.class.getSimpleName(),
            DatePickerDialog.class.getSimpleName(), TimePickerDialog.class.getSimpleName(), };
    boolean[] checkedItems = new boolean[] { true, false, true, false, true };
    Bundle extra = new Bundle();
    extra.putStringArray("items", items);
    new AlertDialogFragment.Builder(context).setIcon(R.drawable.ic_launcher).setTitle(R.string.dialog_title)
            .setMultiChoiceItems(items, checkedItems).setExtra(extra)
            .setPositiveButton(R.string.dialog_ok, null).setNegativeButton(R.string.dialog_cancel, null)
            .show(fragmentManager, label);
}

From source file:com.tundem.actionitembadge.sample.MainActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    setTitle("");

    //add used libraries section to the main activity so the view isn't so empty :D
    Bundle bundle = new Bundle();
    bundle.putStringArray(Libs.BUNDLE_FIELDS, Libs.toStringArray(R.string.class.getFields()));
    bundle.putStringArray(Libs.BUNDLE_LIBS, new String[] { "androidiconify" });

    bundle.putBoolean(Libs.BUNDLE_VERSION, true);
    bundle.putBoolean(Libs.BUNDLE_LICENSE, true);

    LibsFragment fragment = new LibsFragment();
    fragment.setArguments(bundle);//  w ww. j  av a 2  s  . c  o  m

    FragmentManager fragmentManager = getSupportFragmentManager();
    fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
}

From source file:com.tundem.aboutlibraries.sample.FragmentActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_opensource);

    Bundle bundle = new Bundle();
    bundle.putStringArray(Libs.BUNDLE_FIELDS,
            Libs.toStringArray(com.tundem.aboutlibraries.sample.R.string.class.getFields()));
    bundle.putStringArray(Libs.BUNDLE_LIBS,
            new String[] { "crouton", "activeandroid", "actionbarsherlock", "showcaseview" });

    bundle.putBoolean(Libs.BUNDLE_VERSION, true);
    bundle.putBoolean(Libs.BUNDLE_LICENSE, true);

    LibsFragment fragment = new LibsFragment();
    fragment.setArguments(bundle);/* w  w  w  .j  a  v  a2 s .com*/

    FragmentManager fragmentManager = getSupportFragmentManager();
    fragmentManager.beginTransaction().replace(R.id.frame_container, fragment).commit();
}

From source file:com.fbbackup.FriendAlbumListActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    if (BuildConfig.DEBUG) {
        Utils.enableStrictMode();//  w  w w . jav a  2 s  .co m
    }
    super.onCreate(savedInstanceState);

    albumArray = getIntent().getExtras().getStringArray("albumArray");
    albumCoverArray = getIntent().getExtras().getStringArray("albumCoverArray");
    albumCoverUrlArray = getIntent().getExtras().getStringArray("albumCoverUrlArray");
    albumNameArray = getIntent().getExtras().getStringArray("albumNameArray");
    albumPhotoAccountArray = getIntent().getExtras().getStringArray("albumPhotoAccountArray");
    token = getIntent().getExtras().getString("token");
    name = getIntent().getExtras().getString("userName");

    if (getSupportFragmentManager().findFragmentByTag(TAG) == null) {

        Fragment newFragment = new FriendAlbumList();

        Bundle args = new Bundle();

        args.putStringArray("albumArray", albumArray);
        args.putStringArray("albumCoverArray", albumCoverArray);
        args.putStringArray("albumCoverUrlArray", albumCoverUrlArray);
        args.putStringArray("albumNameArray", albumNameArray);
        args.putStringArray("albumPhotoAccountArray", albumPhotoAccountArray);
        args.putString("token", token);
        args.putString("userName", name);

        newFragment.setArguments(args);

        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

        ft.add(android.R.id.content, newFragment, TAG);
        ft.commit();
    }
}

From source file:com.fbbackup.ImageGridActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    if (BuildConfig.DEBUG) {
        Utils.enableStrictMode();/*from   w  w  w  .  j a v  a2s.  c  om*/
    }
    super.onCreate(savedInstanceState);

    photoArray = getIntent().getExtras().getStringArray("albumPhoto");

    albumName = getIntent().getExtras().getString("albumName");

    name = getIntent().getExtras().getString("userName");

    for (int i = 0; i < photoArray.length; i++) {
        Log.w("photo", i + ":" + photoArray[i]);
    }

    if (getSupportFragmentManager().findFragmentByTag(TAG) == null) {

        Fragment newFragment = new ImageGridFragment();

        Bundle args = new Bundle();

        args.putStringArray("photo", photoArray);

        args.putString("albumName", albumName);

        args.putString("userName", name);

        Log.w("downloadpic", "ImageGridActivity albumName:" + albumName);

        newFragment.setArguments(args);

        final FragmentTransaction ft = getSupportFragmentManager().beginTransaction();

        ft.add(android.R.id.content, newFragment, TAG);
        ft.commit();
    }
}

From source file:librerias.ActivityProgress_detalle.java

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
@Override//from   w  w  w  .j  a va2 s .c o  m
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setTitle("Detalle del Trmite");

    int titleId = Resources.getSystem().getIdentifier("action_bar_title", "id", "android");
    if (titleId == 0)
        titleId = com.actionbarsherlock.R.id.abs__action_bar_title;

    TextView custom = (TextView) findViewById(titleId);
    custom.setTypeface(CustomTypeFace.getInstance(this).getTypeFace());

    Bundle bundle = getIntent().getExtras();
    datos_tramite = bundle.getStringArray("datos_tramite");

    //verifica si tienes coneccin a internet
    if (verifica_internet.checkConex(getApplicationContext())) {
        Fragment fragment = getSupportFragmentManager().findFragmentById(android.R.id.content);
        if (fragment == null) {
            fragment = Detalle_tramite.newInstance();
            Bundle args = new Bundle();
            args.putStringArray("datos_tramite", datos_tramite);
            fragment.setArguments(args);
            getSupportFragmentManager().beginTransaction().add(android.R.id.content, fragment).commit();
        }
        //getSupportActionBar().setTitle("Lista de Trmites");

    } else {
        Toast.makeText(getApplicationContext(), "Verifique estar conectado a INTERNET", Toast.LENGTH_LONG)
                .show();
        finish();
    }

}