Example usage for android.os Bundle putString

List of usage examples for android.os Bundle putString

Introduction

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

Prototype

public void putString(@Nullable String key, @Nullable String value) 

Source Link

Document

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

Usage

From source file:com.firebase.ui.auth.provider.FacebookProvider.java

public static IDPProviderParcel createFacebookParcel(String applicationId) {
    Bundle extra = new Bundle();
    extra.putString(APPLICATION_ID, applicationId);
    return new IDPProviderParcel(FacebookAuthProvider.PROVIDER_ID, extra);
}

From source file:com.facebook.internal.ServerProtocol.java

public static Bundle getQueryParamsForPlatformActivityIntentWebFallback(Context context, String callId,
        int version, String applicationName, Bundle methodArgs) {

    String keyHash = Settings.getApplicationSignature(context);
    if (Utility.isNullOrEmpty(keyHash)) {
        return null;
    }//  w w  w . j a v  a2 s  .  c o  m

    Bundle webParams = new Bundle();

    webParams.putString(FALLBACK_DIALOG_PARAM_KEY_HASH, keyHash);
    webParams.putString(FALLBACK_DIALOG_PARAM_APP_ID, Settings.getApplicationId());
    webParams.putInt(FALLBACK_DIALOG_PARAM_VERSION, version);
    webParams.putString(DIALOG_PARAM_DISPLAY, FALLBACK_DIALOG_DISPLAY_VALUE_TOUCH);

    Bundle bridgeArguments = new Bundle();
    bridgeArguments.putString(NativeProtocol.BRIDGE_ARG_ACTION_ID_STRING, callId);
    bridgeArguments.putString(NativeProtocol.BRIDGE_ARG_APP_NAME_STRING, applicationName);

    methodArgs = (methodArgs == null) ? new Bundle() : methodArgs;

    try {
        JSONObject bridgeArgsJSON = BundleJSONConverter.convertToJSON(bridgeArguments);
        JSONObject methodArgsJSON = BundleJSONConverter.convertToJSON(methodArgs);

        if (bridgeArgsJSON == null || methodArgsJSON == null) {
            return null;
        }

        webParams.putString(FALLBACK_DIALOG_PARAM_BRIDGE_ARGS, bridgeArgsJSON.toString());
        webParams.putString(FALLBACK_DIALOG_PARAM_METHOD_ARGS, methodArgsJSON.toString());
    } catch (JSONException je) {
        webParams = null;
        Logger.log(LoggingBehavior.DEVELOPER_ERRORS, Log.ERROR, TAG, "Error creating Url -- " + je);
    }

    return webParams;
}

From source file:com.sawyer.advadapters.app.dialogs.AddJSONArrayDialogFragment.java

public static AddJSONArrayDialogFragment newInstance() {
    AddJSONArrayDialogFragment frag = new AddJSONArrayDialogFragment();

    //Generate unique movie listing
    Set<MovieItem> tempMovies = new HashSet<>();
    while (tempMovies.size() != 3) {
        int index = new Random().nextInt(MovieContent.ITEM_LIST.size());
        tempMovies.add(MovieContent.ITEM_LIST.get(index));
    }//ww  w. j av  a 2s .  co  m

    //Convert over to JSONArray
    JSONArray movies = new JSONArray();
    for (MovieItem movie : tempMovies) {
        movies.put(movie.toJSONObject());
    }

    Bundle bundle = new Bundle();
    bundle.putString(STATE_MOVIES, movies.toString());
    frag.setArguments(bundle);

    return frag;
}

From source file:com.mikecorrigan.trainscorekeeper.FragmentHistory.java

public static FragmentHistory newInstance(int index, JSONObject jsonSpec) {
    Log.vc(VERBOSE, TAG, "newInstance: jsonTab=" + jsonSpec);

    FragmentHistory fragment = new FragmentHistory();
    Bundle args = new Bundle();
    args.putInt(ARG_INDEX, index);//from   ww  w . j  a  v  a 2 s. c o  m
    args.putString(ARG_TAB_SPEC, jsonSpec.toString());
    fragment.setArguments(args);
    return fragment;
}

From source file:com.skubit.bitid.fragments.SignInResponseFragment.java

public static SignInResponseFragment newInstance(int resultCode, String message) {
    SignInResponseFragment signInResponseFragment = new SignInResponseFragment();
    Bundle bundle = new Bundle();
    bundle.putInt("resultCode", resultCode);
    if (!TextUtils.isEmpty(message)) {
        bundle.putString("message", message);
    }//from   www  .j  a  va 2s.c o m

    signInResponseFragment.setArguments(bundle);
    return signInResponseFragment;
}

From source file:es.wolfi.app.passman.CredentialDisplay.java

/**
 * Use this factory method to create a new instance of
 * this fragment using the provided parameters.
 *
 * @param credentialGUID The guid of the credential to display.
 * @return A new instance of fragment CredentialDisplay.
 *//* w ww. jav a  2  s.  co  m*/
// TODO: Rename and change types and number of parameters
public static CredentialDisplay newInstance(String credentialGUID) {
    CredentialDisplay fragment = new CredentialDisplay();

    Bundle b = new Bundle();
    b.putString(CREDENTIAL, credentialGUID);
    fragment.setArguments(b);

    return fragment;
}

From source file:behsaman.storytellerandroid.ScreenSlidePageFragment.java

/**
 * Factory method for this fragment class. Constructs a new fragment for the given page number.
 *///from   w w  w . j a  v a 2  s .c o  m
public static ScreenSlidePageFragment create(PieceModel model, STORY_TYPE type, Context parentCon) {
    parentContext = parentCon;
    ScreenSlidePageFragment fragment = new ScreenSlidePageFragment();
    Bundle args = new Bundle();
    args.putSerializable(ARG_MODEL, model);
    args.putString(ARG_TYPE, type.toString());
    fragment.setArguments(args);
    return fragment;
}

From source file:com.google.android.apps.authenticator.dataexport.Exporter.java

private static Bundle getAccountDbBundle(AccountDb accountDb) {
    List<String> accountNames = new ArrayList<String>();
    accountDb.getNames(accountNames);/*from   www.  j a v a2  s  . co m*/

    Bundle result = new Bundle();
    int accountPosition = 0;
    for (String accountName : accountNames) {
        accountPosition++;
        Bundle account = new Bundle();
        account.putString("name", accountName);
        account.putString("encodedSecret", accountDb.getSecret(accountName));
        account.putInt("counter", accountDb.getCounter(accountName));
        AccountDb.OtpType accountType = accountDb.getType(accountName);
        String serializedAccountType;
        switch (accountType) {
        case HOTP:
            serializedAccountType = "hotp";
            break;
        case TOTP:
            serializedAccountType = "totp";
            break;
        default:
            throw new RuntimeException("Unsupported account type: " + accountType);
        }
        account.putString("type", serializedAccountType);
        result.putBundle(String.valueOf(accountPosition), account);
    }
    return result;
}

From source file:com.royclarkson.springagram.PhotoAddToGalleryFragment.java

public static PhotoAddToGalleryFragment newInstance(String itemGalleryUrl) {
    PhotoAddToGalleryFragment fragment = new PhotoAddToGalleryFragment();
    Bundle args = new Bundle();
    args.putString(ARG_PHOTO_GALLERY_URL, itemGalleryUrl);
    fragment.setArguments(args);//from w  w  w.j a  v a 2 s  . co  m
    return fragment;
}

From source file:com.thevelopment.poc.Fragments.FirstFragment.java

public static FirstFragment newInstance(String text) {

    FirstFragment f = new FirstFragment();
    Bundle b = new Bundle();
    b.putString("msg", text);

    f.setArguments(b);//from w w w .  j a v  a 2s .co  m

    return f;
}