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.jaspersoft.android.jaspermobile.test.acceptance.SearchableActivityTest.java

private void configureSearchIntent() {
    Intent launchIntent = new Intent();
    launchIntent.setAction(Intent.ACTION_SEARCH);
    Bundle extras = new Bundle();
    extras.putString(SearchableActivity_.QUERY_EXTRA, SEARCH_QUERY);
    launchIntent.putExtras(extras);//  w w  w . ja v  a2s  .c  o  m
    setActivityIntent(launchIntent);
}

From source file:com.mercandalli.android.apps.files.file.text.FileTextActivity.java

@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
    savedInstanceState.putString(KEY_SAVED_TEXT, mInitialText);
    super.onSaveInstanceState(savedInstanceState);
}

From source file:org.ale.scanner.zotero.web.googlebooks.GoogleBooksAPIClient.java

public void isbnLookup(String isbn) {
    APIRequest r = newRequest();/*from w ww  .  j  a va 2s .  c om*/
    r.setHttpMethod(APIRequest.GET);
    r.setURI(URI.create(BOOK_SEARCH_ISBN + isbn));
    Bundle extra = new Bundle();
    extra.putString(GoogleBooksAPIClient.EXTRA_ISBN, isbn);
    r.setExtra(extra);

    mRequestQueue.enqueue(r);
}

From source file:org.umit.icm.mobile.social.TwitterUpdate.java

/**
 * Sends a Tweet using the Notification Service. 
 * //from w  w  w .  j a  va 2  s. c om
 * 
         
 @param   message      An object of type String which represents the Tweet.
 *
         
 @see Intent 
 */
public synchronized void sendTweet(String message, Context context) {
    Bundle bundle = new Bundle();
    bundle.putString("twitter", message);
    Intent intent = new Intent("org.umit.icm.mobile.TWITTER_SERVICE");
    intent.putExtras(bundle);
    context.sendBroadcast(intent);
}

From source file:fr.julienvermet.bugdroid.service.CommentIntentService.java

private void sendResult(Intent intent, int statusCode, String result) {
    Bundle extras = intent.getExtras();/*from  w  w  w. jav a 2s.  c om*/
    Messenger messenger = (Messenger) extras.get(MESSENGER);
    if (messenger != null) {
        Message msg = Message.obtain();
        Bundle data = new Bundle();
        data.putInt(STATUS_CODE, statusCode);
        data.putString(RESULT, result);
        msg.setData(data);
        try {
            messenger.send(msg);
        } catch (android.os.RemoteException e1) {
            Log.w(getClass().getName(), "Exception sending message", e1);
        }
    }
}

From source file:com.parse.loginsample.withdispatchactivity.SampleProfileActivity.java

private void getFbMe() {
    AccessToken token = AccessToken.getCurrentAccessToken();
    GraphRequest request = GraphRequest.newMeRequest(token, new GraphRequest.GraphJSONObjectCallback() {
        @Override/*from  w  ww .  j av a 2  s  . co m*/
        public void onCompleted(JSONObject object, GraphResponse response) {
            // Application code
            Log.d(TAG, "Response " + response.toString());
            Log.d(TAG, "object " + object.toString());
        }
    });
    Bundle parameters = new Bundle();
    parameters.putString("fields", "id,name,link");
    request.setParameters(parameters);
    request.executeAsync();
}

From source file:com.easy.facebook.android.apicall.FQL.java

public Friend getFriend(String uid) throws EasyFacebookError {
    Bundle params = new Bundle();
    params.putString("format", "json");
    params.putString("method", "fql.query");
    params.putString("access_token", facebook.getAccessToken());

    String fqlQuery = (new StringBuilder(
            "SELECT uid, name, pic, profile_update_time, timezone, birthday_date, status, online_presence, locale, profile_url, website, is_blocked FROM user WHERE uid="))
                    .append(uid).toString();
    params.putString("query", fqlQuery);

    String jsonResponse;/*from   w w  w.  jav a  2s  . c om*/
    try {
        jsonResponse = Util.openUrl("https://api.facebook.com/restserver.php", "POST", params);

        JSONObjectDecode jsonArray = new JSONObjectDecode(jsonResponse);
        return jsonArray.getFriend(0);

    } catch (MalformedURLException e) {

        throw new EasyFacebookError(e.toString(), "MalformedURLException");
    } catch (IOException e) {

        throw new EasyFacebookError(e.toString(), "IOException");
    } catch (JSONException e) {

        throw new EasyFacebookError(e.toString(), "JSONException");
    }

}

From source file:com.irccloud.android.fragment.NamesListFragment.java

@Override
public void onSaveInstanceState(Bundle state) {
    state.putString("event", event.toString());
}

From source file:com.facebook.TestSessionTests.java

private int countTestUsers() {
    TestSession session = getTestSessionWithSharedUser(null);

    String appAccessToken = TestSession.getAppAccessToken();
    assertNotNull(appAccessToken);/*from   w w  w.  jav a  2 s  .  c o  m*/

    Bundle parameters = new Bundle();

    parameters.putString("access_token", appAccessToken);
    parameters.putString("fields", "id");

    Request requestTestUsers = new Request(null, "app/accounts/test-users", parameters, null);

    Response response = requestTestUsers.executeAndWait();

    JSONArray data = (JSONArray) response.getGraphObject().getProperty("data");
    return data.length();
}

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

@Override
public void onCancel() {
    Bundle extra = new Bundle();
    extra.putString(ERROR, "cancelled");
    mCallbackObject.onFailure(extra);//  ww  w  .j  a va 2s .c  o  m

}