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.facebook.android.UploadPhotoResultDialog.java

public void setTag() {
    String relativePath = photo_id + "/tags/" + Utility.userUID;
    Bundle params = new Bundle();
    params.putString("x", "5");
    params.putString("y", "5");
    Utility.mAsyncRunner.request(relativePath, params, "POST", new TagPhotoRequestListener(), null);
}

From source file:net.idlesoft.android.apps.github.activities.CreateIssue.java

@Override
public void onSaveInstanceState(final Bundle savedInstanceState) {
    savedInstanceState.putString("titleText",
            ((EditText) findViewById(R.id.et_create_issue_title)).getText().toString());
    savedInstanceState.putString("bodyText",
            ((EditText) findViewById(R.id.et_create_issue_body)).getText().toString());
    super.onSaveInstanceState(savedInstanceState);
}

From source file:com.nextgis.maplibui.formcontrol.AutoTextEdit.java

@Override
public void saveState(Bundle outState) {
    outState.putString(ControlHelper.getSavedStateKey(mFieldName), (String) getValue());
}

From source file:com.chess.genesis.activity.RegisterFrag.java

private void register_validate() {
    EditText txt = (EditText) act.findViewById(R.id.username);
    final String username = txt.getText().toString().trim();
    if (!valid_username(username))
        return;/*from  ww  w  . j a  v a2 s .com*/

    txt = (EditText) act.findViewById(R.id.password);
    final String password = txt.getText().toString();
    txt = (EditText) act.findViewById(R.id.password2);
    final String password2 = txt.getText().toString();
    if (!valid_password(password, password2))
        return;

    txt = (EditText) act.findViewById(R.id.email);
    final String email = txt.getText().toString().trim();
    if (!valid_email(email))
        return;

    final Bundle bundle = new Bundle();
    bundle.putString("username", username);
    bundle.putString("password", password);
    bundle.putString("email", email);

    new RegisterConfirm(act, handle, bundle).show();
}

From source file:com.facebook.login.LoginLogger.java

public void logUnexpectedError(String eventName, String errorMessage, String method) {
    Bundle bundle = newAuthorizationLoggingBundle("");
    bundle.putString(EVENT_PARAM_LOGIN_RESULT, LoginClient.Result.Code.ERROR.getLoggingValue());
    bundle.putString(EVENT_PARAM_ERROR_MESSAGE, errorMessage);
    bundle.putString(EVENT_PARAM_METHOD, method);

    appEventsLogger.logSdkEvent(eventName, null, bundle);
}

From source file:org.ale.scanner.zotero.web.worldcat.WorldCatAPIClient.java

public void isbnLookup(String isbn) {
    APIRequest r = newRequest();/*from  w  w  w . java2s . com*/
    r.setHttpMethod(APIRequest.GET);
    r.setURI(URI.create(String.format(XISBN_SEARCH, isbn)));
    Bundle extra = new Bundle();
    extra.putString(WorldCatAPIClient.EXTRA_ISBN, isbn);
    r.setExtra(extra);

    mRequestQueue.enqueue(r);
}

From source file:org.ale.scanner.zotero.web.worldcat.WorldCatAPIClient.java

public void issnLookup(String issn) {
    APIRequest r = newRequest();/*from   w ww .  j  ava  2 s .c  om*/
    r.setHttpMethod(APIRequest.GET);
    r.setURI(URI.create(String.format(XISSN_SEARCH, issn)));
    Bundle extra = new Bundle();
    extra.putString(WorldCatAPIClient.EXTRA_ISBN, issn);
    r.setExtra(extra);

    mRequestQueue.enqueue(r);
}

From source file:org.jprofit.wsfscanner.ScannerActivity.java

@Override
public void onSaveInstanceState(Bundle outState) {
    outState.putString(HTML_KEY, webViewContent);
}

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

public void testSetHttpHeaders() {
    MockHttpClient client = new MockHttpClient();
    client.setContext(getContext());//from   w w  w  .  j a va  2 s .  co  m
    String response = null;

    try {
        Bundle headers = new Bundle();
        headers.putString("Authorization", "Let me in");

        response = HttpUtils.openUrl(client, OK_REQUEST, HttpUtils.METHOD_GET, null, null, headers);
    } catch (HttpResponseException e) {
        fail("Received a response exception: " + e.toString());
    }

    Header[] headers = client.getRequest().getHeaders("Authorization");

    if (headers != null && headers.length > 0) {
        assertEquals("Let me in", headers[0].getValue());
    } else {
        fail("Headers are not properly set");
    }

    if (response == null) {
        fail("Unexpected empty response");
    }
}

From source file:models.newArrivalFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_newarrival, container, false);
    getActivity().setTitle("New Arrivals!");

    //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. j  av a 2s. c o m
        teaInfo = new GetTeaInfoTask().execute(new ApiConnector()).get();
    } catch (InterruptedException e) {
        e.printStackTrace();
    } catch (ExecutionException e) {
        e.printStackTrace();
    }
    //make the gridview and set its adapter
    GridView gridView = (GridView) rootView.findViewById(R.id.grid_view_new_arrival);
    GridViewCustomAdapter gvAdapter = new GridViewCustomAdapter(getActivity(), teaInfo.imageURLs,
            teaInfo.teaNames);
    gridView.setAdapter(gvAdapter);

    //onclick listener for gridview
    gridView.setOnItemClickListener(new OnItemClickListener() {

        public void onItemClick(AdapterView<?> parent, View v, int position, long id) {

            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));
            Fragment newFragment = new TeaViewFragment();
            newFragment.setArguments(teaViewArgs);

            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;
}