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.akoscz.youtube.YouTubeRecyclerViewFragment.java

/**
 * Use this factory method to create a new instance of
 * this fragment using the provided parameters.
 *
 * @param youTubeDataApi/*from www .  j  a  va2 s.  co m*/
 * @param playlistIds A String array of YouTube Playlist IDs
 * @return A new instance of fragment YouTubeRecyclerViewFragment.
 */
public static YouTubeRecyclerViewFragment newInstance(YouTube youTubeDataApi, String[] playlistIds) {
    YouTubeRecyclerViewFragment fragment = new YouTubeRecyclerViewFragment();
    Bundle args = new Bundle();
    args.putStringArray(ARG_YOUTUBE_PLAYLIST_IDS, playlistIds);
    fragment.setArguments(args);
    fragment.setYouTubeDataApi(youTubeDataApi);
    return fragment;
}

From source file:com.owncloud.android.ui.dialog.ShareLinkToDialog.java

public static ShareLinkToDialog newInstance(Intent intent, String[] packagesToExclude, OCFile fileToShare) {
    ShareLinkToDialog f = new ShareLinkToDialog();
    Bundle args = new Bundle();
    args.putParcelable(ARG_INTENT, intent);
    args.putStringArray(ARG_PACKAGES_TO_EXCLUDE, packagesToExclude);
    args.putParcelable(ARG_FILE_TO_SHARE, fileToShare);
    f.setArguments(args);//from  w ww.  j a v a2 s. c  o m
    return f;
}

From source file:com.github.johnpersano.supertoasts.demo.fragments.AttributeSpinnerFragment.java

/**
 * Returns a new instance of the {@link AttributeSpinnerFragment}.
 *
 * @param title The title to be shown in the TabStrip
 * @param subtitle The large subtitle//from  w  w w  . j  a  v a 2s. c om
 * @param summary A summary of the Spinner
 * @param array The selection options of the Spinner
 *
 * @return A new AttributeSpinnerFragment
 */
public static AttributeSpinnerFragment newInstance(String title, String subtitle, String summary,
        String[] array) {
    final AttributeSpinnerFragment attributeSpinnerFragment = new AttributeSpinnerFragment();

    final Bundle bundle = new Bundle();
    bundle.putString(ARG_TITLE, title);
    bundle.putString(ARG_SUBTITLE, subtitle);
    bundle.putString(ARG_SUMMARY, summary);
    bundle.putStringArray(ARG_ARRAY_ID, array);

    attributeSpinnerFragment.setArguments(bundle);
    return attributeSpinnerFragment;
}

From source file:com.dm.wallpaper.board.fragments.dialogs.InAppBillingFragment.java

private static InAppBillingFragment newInstance(String key, String[] productId) {
    InAppBillingFragment fragment = new InAppBillingFragment();
    Bundle bundle = new Bundle();
    bundle.putString(Extras.EXTRA_KEY, key);
    bundle.putStringArray(Extras.EXTRA_PRODUCT_ID, productId);
    fragment.setArguments(bundle);//w  w  w .j  av  a  2s.c o  m
    return fragment;
}

From source file:dev.drsoran.moloko.fragments.dialogs.ChooseTagsDialogFragment.java

public final static void show(FragmentActivity activity, Collection<String> tags) {
    final Bundle config = new Bundle(2);

    String[] tagsArray = new String[tags.size()];
    tagsArray = tags.toArray(tagsArray);

    config.putStringArray(Config.TAG_STRINGS, tagsArray);
    config.putBooleanArray(Config.SELECTION_STATE, new boolean[tagsArray.length]);

    show(activity, config);//  ww w  .j av a2 s  . co  m
}

From source file:uk.org.rivernile.edinburghbustracker.android.fragments.dialogs.ServicesChooserDialogFragment.java

/**
 * Create a new instance of this Fragment, providing a list of services to
 * select from, a list of services to select by default and a title for the
 * Dialog./*from   www  . j  av a2 s  . c o  m*/
 * 
 * @param services The list of services to show to the user.
 * @param selectedServices The services to select by default, null if none.
 * @param dialogTitle The title to use for the Dialog.
 * @return A new instance of this Fragment.
 */
public static ServicesChooserDialogFragment newInstance(final String[] services,
        final String[] selectedServices, final String dialogTitle) {
    final ServicesChooserDialogFragment f = new ServicesChooserDialogFragment();
    final Bundle b = new Bundle();
    b.putStringArray(ARG_SERVICES, services);
    b.putStringArray(ARG_SELECTED_SERVICES, selectedServices);
    b.putString(ARG_TITLE, dialogTitle);
    f.setArguments(b);

    return f;
}

From source file:com.dm.material.dashboard.candybar.fragments.dialog.InAppBillingFragment.java

private static InAppBillingFragment newInstance(int type, String key, String[] productId, int[] productCount) {
    InAppBillingFragment fragment = new InAppBillingFragment();
    Bundle bundle = new Bundle();
    bundle.putInt(TYPE, type);/*from  ww  w .  j a  v  a  2  s  . c o  m*/
    bundle.putString(KEY, key);
    bundle.putStringArray(PRODUCT_ID, productId);
    if (productCount != null)
        bundle.putIntArray(PRODUCT_COUNT, productCount);
    fragment.setArguments(bundle);
    return fragment;
}

From source file:de.aw.monma.cash.FragmentBuchungenSaldoListe.java

/**
 * Erstellt ein neues FragmentBuchungenListe
 *
 * @param account/*w w  w .ja  v a2 s . com*/
 *         Konto, dessen Buchungen angezeigt werden sollen.
 *
 * @return Neues Fragment
 */
public static FragmentBuchungenSaldoListe newInstance(Account account) {
    Bundle args = new Bundle();
    args.putParcelable(ACCOUNT, account);
    args.putString(SELECTION, selection);
    String[] selectionArgs = new String[] { String.valueOf(account.getID()) };
    args.putStringArray(SELECTIONARGS, selectionArgs);
    args.putString(ORDERBY, orderBy);
    FragmentBuchungenSaldoListe f = new FragmentBuchungenSaldoListe();
    f.setArguments(args);
    return f;
}

From source file:org.chromium.chrome.browser.preferences.privacy.ConfirmImportantSitesDialogFragment.java

/**
 * Constructs a new instance of the important sites dialog fragment.
 * @param importantDomains The list of important domains to display.
 * @param importantDomainReasons The reasons for choosing each important domain.
 * @param faviconURLs The list of favicon urls that correspond to each importantDomains.
 * @return An instance of ConfirmImportantSitesDialogFragment with the bundle arguments set.
 */// w  w w.  j av  a  2 s. co m
public static ConfirmImportantSitesDialogFragment newInstance(String[] importantDomains,
        int[] importantDomainReasons, String[] faviconURLs) {
    ConfirmImportantSitesDialogFragment dialogFragment = new ConfirmImportantSitesDialogFragment();
    Bundle bundle = new Bundle();
    bundle.putStringArray(IMPORTANT_DOMAINS_TAG, importantDomains);
    bundle.putIntArray(IMPORTANT_DOMAIN_REASONS_TAG, importantDomainReasons);
    bundle.putStringArray(FAVICON_URLS_TAG, faviconURLs);
    dialogFragment.setArguments(bundle);
    return dialogFragment;
}

From source file:com.sweetiepiggy.littlepro.QuestionFragment.java

public static QuestionFragment newInstance(Question question, boolean submitted) {
    QuestionFragment fragment = new QuestionFragment();
    Bundle args = new Bundle();
    args.putLong(ARG_QUESTION_ID, question.getId());
    args.putString(ARG_QUESTION, question.getQuestion());
    args.putBoolean(ARG_SUBMITTED, submitted);
    args.putStringArray(ARG_ANSWER_CHOICES, question.getAnswerChoices().toArray(new String[0]));
    fragment.setArguments(args);/* ww w .j a v  a  2  s.  co  m*/
    return fragment;
}