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:de.lebenshilfe_muenster.uk_gebaerden_muensterland.sign_browser.search.SignSearchActivity.java

@Override
public void onSignBrowserAdapterSignClicked(Sign sign) {
    Log.d(TAG, "onSignBrowserAdapterSignClicked() " + this.hashCode());
    final Intent intent = new Intent(this, SignSearchVideoActivity.class);
    final Bundle bundle = new Bundle();
    bundle.putString(SignSearchActivity.QUERY, this.query);
    bundle.putParcelable(SignVideoFragment.SIGN_TO_SHOW, sign);
    intent.putExtra(SignSearchVideoActivity.EXTRA, bundle);
    startActivity(intent);/*from w ww. j  a  v  a 2  s. com*/
}

From source file:at.bitfire.davdroid.syncadapter.LoginURLFragment.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.next:
        FragmentTransaction ft = getFragmentManager().beginTransaction();

        Bundle args = new Bundle();
        try {//from  w ww.  j  av a 2  s.  c  o m
            args.putString(QueryServerDialogFragment.EXTRA_BASE_URI, getBaseURI().toString());
        } catch (URISyntaxException e) {
        }
        args.putString(QueryServerDialogFragment.EXTRA_USER_NAME, editUserName.getText().toString());
        args.putString(QueryServerDialogFragment.EXTRA_PASSWORD, editPassword.getText().toString());
        args.putBoolean(QueryServerDialogFragment.EXTRA_AUTH_PREEMPTIVE, checkboxPreemptive.isChecked());

        DialogFragment dialog = new QueryServerDialogFragment();
        dialog.setArguments(args);
        dialog.show(ft, QueryServerDialogFragment.class.getName());
        break;
    default:
        return false;
    }
    return true;
}

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

@Override
public void onSuccess(final LoginResult loginResult) {
    if (BuildConfig.DEBUG) {
        Log.d(TAG,/*from w w w.j  av a2  s .co  m*/
                "Login to facebook successful with Application Id: "
                        + loginResult.getAccessToken().getApplicationId() + " with Token: "
                        + loginResult.getAccessToken().getToken());
    }
    GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(),
            new GraphRequest.GraphJSONObjectCallback() {
                @Override
                public void onCompleted(JSONObject object, GraphResponse response) {
                    try {
                        String email = object.getString("email");
                        mCallbackObject.onSuccess(createIDPResponse(loginResult, email));
                    } catch (JSONException e) {
                        e.printStackTrace();
                        mCallbackObject.onFailure(new Bundle());
                    }
                }
            });
    Bundle parameters = new Bundle();
    parameters.putString("fields", "id,name,email");
    request.setParameters(parameters);
    request.executeAsync();
}

From source file:com.del7a.capptain.Capptain.java

public void initialize(CordovaInterface _cordova, CordovaWebView webView) {

    CordovaActivity Activity = (CordovaActivity) _cordova.getActivity();
    final String invokeString = Activity.getIntent().getDataString();
    if (invokeString != "" && invokeString != null) {
        lastRedirect = invokeString;/*ww w.j a  v a 2 s.  co  m*/
        System.out.println("Preparing Redirect to " + lastRedirect);
    }
    super.initialize(_cordova, webView);
    cordova = _cordova;

    Bundle b = new Bundle();
    b.putString("CDVCapptainVersion", pluginVersion);
    CapptainAgent.getInstance(cordova.getActivity()).sendAppInfo(b);
}

From source file:com.parse.PushRouter.java

public synchronized boolean handlePush(String pushId, String timestamp, String channel, JSONObject data) {
    if (ParseTextUtils.isEmpty(pushId) || ParseTextUtils.isEmpty(timestamp)) {
        return false;
    }//from w  w w . ja  va  2 s .  co  m

    if (!history.tryInsertPush(pushId, timestamp)) {
        return false;
    }

    // Persist the fact that we've seen this push.
    saveStateToDisk();

    Bundle extras = new Bundle();
    extras.putString(ParsePushBroadcastReceiver.KEY_PUSH_CHANNEL, channel);
    if (data == null) {
        extras.putString(ParsePushBroadcastReceiver.KEY_PUSH_DATA, "{}");
    } else {
        extras.putString(ParsePushBroadcastReceiver.KEY_PUSH_DATA, data.toString());
    }

    Intent intent = new Intent(ParsePushBroadcastReceiver.ACTION_PUSH_RECEIVE);
    intent.putExtras(extras);

    // Set the package name to keep this intent within the given package.
    Context context = Parse.getApplicationContext();
    intent.setPackage(context.getPackageName());
    context.sendBroadcast(intent);

    return true;
}

From source file:club.frickel.feelathome.DeviceFragment.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putString(Constants.DEVICE_ID, this.deviceID);
    super.onSaveInstanceState(outState);
}

From source file:com.groupme.sdk.util.HttpUtilsTest.java

public void testBundleToList() {
    Bundle params = new Bundle();
    params.putString("group", "myawesomegroup");
    params.putString("platform", "android");
    params.putString("locale", "us");

    List<NameValuePair> pairs = HttpUtils.bundleToList(params);
    assertNotNull(pairs);/*w w w  .j  a  va  2 s .c o  m*/
    assertEquals(pairs.size(), params.size());

    for (NameValuePair pair : pairs) {
        assertNotNull(pair);
        assertEquals(pair.getValue(), params.getString(pair.getName()));
    }
}

From source file:com.groupme.sdk.util.HttpUtilsTest.java

public void testEncodeParams() {
    Bundle params = new Bundle();
    params.putString("format", "json");
    params.putString("key", "thisisatestkey");
    params.putString("foo", "bar");

    String expected = "foo=bar&key=thisisatestkey&format=json";
    String encodedParams = HttpUtils.encodeParams(params);

    assertEquals(expected, encodedParams);

    Bundle nullParams = null;/*  w  ww .  j a va  2  s.  com*/
    String encodedNull = HttpUtils.encodeParams(nullParams);

    assertEquals("", encodedNull);
}

From source file:com.example.t_danbubbletea.MySelections.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_tea_selections, container, false);
    getActivity().setTitle("Tea Selections");
    // animation when enter home page
    rootView.startAnimation(AnimationUtils.loadAnimation(getActivity(), R.anim.image_click));
    //download the URL's asynchronously (put the info in the teaInfo object)
    try {//from   w  w w  . ja v  a 2  s  .c  o m
        teaInfo = new GetTeaInfoTask().execute(new ApiConnector()).get();
    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (ExecutionException e) {
        e.printStackTrace();
    }
    //make the gridview, set its adapter
    GridView gridView = (GridView) rootView.findViewById(R.id.grid_view_tea_selections);
    GridViewCustomAdapter gvAdapter = new GridViewCustomAdapter(getActivity(), teaInfo.imageURLs,
            teaInfo.teaNames);
    gridView.setAdapter(gvAdapter);
    //make the on click listeners
    gridView.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
            Fragment newFragment;
            switch (position) {
            default:
                Bundle teaViewArgs = new Bundle();
                teaViewArgs.putString("teaName", teaInfo.teaNames.get(position));
                teaViewArgs.putString("teaImgUrl", teaInfo.imageURLs.get(position));
                teaViewArgs.putString("teaDesc", teaInfo.teaDescriptions.get(position));
                newFragment = new TeaViewFragment();
                newFragment.setArguments(teaViewArgs);
                break;

            }
            if (newFragment != null) {
                flipCard(newFragment);
            }
        }

        private void flipCard(Fragment newFragment) {
            mShowingBack = true;
            FragmentManager fragmentManager = getFragmentManager();
            fragmentManager.beginTransaction()
                    .setCustomAnimations(R.anim.card_flip_right_in, R.anim.card_flip_right_out,
                            R.anim.card_flip_left_in, R.anim.card_flip_left_out)
                    .replace(R.id.frame_container, newFragment).addToBackStack(null).commit(); // create new fragment and allow user to go back to previous fragment          
        }
    });
    return rootView;
}

From source file:ee.ria.DigiDoc.activity.OpenExternalFileActivity.java

private void createContainerDetailsFragment(ContainerFacade container) {
    FragmentManager fragmentManager = getSupportFragmentManager();
    ContainerDetailsFragment containerDetailsFragment = findContainerDetailsFragment();
    if (containerDetailsFragment != null) {
        return;//ww w.j  av a  2s. c om
    }
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    Bundle extras = new Bundle();

    extras.putString(Constants.CONTAINER_NAME_KEY, container.getName());
    extras.putString(Constants.CONTAINER_PATH_KEY, container.getAbsolutePath());

    containerDetailsFragment = new ContainerDetailsFragment();
    setTitle(R.string.bdoc_detail_title);
    containerDetailsFragment.setArguments(extras);
    fragmentTransaction.add(R.id.container_layout_holder, containerDetailsFragment,
            ContainerDetailsFragment.TAG);
    fragmentTransaction.commit();
}