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.brennasoft.facebookdashclockextension.fbclient.NotificationsRequest.java

public NotificationsResponse execute(Session session) {
    NotificationsResponse notificationsResponse = new NotificationsResponse();
    if (session.isOpened()) {
        Bundle parameters = new Bundle();
        parameters.putString("q", q);
        Request request = new Request(session, "/fql", parameters, HttpMethod.GET);
        Response response = request.executeAndWait();
        FacebookRequestError error = response.getError();
        if (error == null) {
            notificationsResponse = parseResponse(response);
        }//from w ww .  jav a  2s  . co  m
    }
    return notificationsResponse;
}

From source file:com.facebook.TestUserManagerTests.java

private int countTestUsers() {
    TestUserManager testUserManager = createTestUserManager();

    String appAccessToken = testUserManager.getAppAccessToken();
    assertNotNull(appAccessToken);//from w ww . j  av a2  s. c om

    Bundle parameters = new Bundle();

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

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

    GraphResponse response = requestTestUsers.executeAndWait();

    JSONArray data = response.getJSONObject().optJSONArray("data");
    return data.length();
}

From source file:org.anhonesteffort.flock.registration.model.FlockCardInformation.java

public Bundle toBundle() {
    Bundle bundle = new Bundle();

    bundle.putString(KEY_ACCOUNT_ID, accountId);
    bundle.putString(KEY_LAST_FOUR, cardLastFour);
    bundle.putString(KEY_EXPIRATION, cardExpiration);

    return bundle;
}

From source file:com.normalexception.app.rx8club.task.ProfileTask.java

@Override
protected void onPostExecute(Void result) {
    try {//www  .  j a v a  2s.  c o m
        mProgressDialog.dismiss();
        mProgressDialog = null;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
    }

    Bundle args = new Bundle();
    args.putString("link", HtmlFormUtils.getResponseUrl());
    FragmentUtils.fragmentTransaction(sourceFragment.getActivity(), new UserCpFragment(), false, true, args);
}

From source file:com.brennasoft.facebookdashclockextension.fbclient.NotificationsRequest.java

public NotificationsResponse executeWithApplicationFilter(Session session, Set<String> applicationTypes) {
    NotificationsResponse notificationsResponse = null;
    if (session.isOpened()) {
        Bundle parameters = new Bundle();
        parameters.putString("q",
                q + " and app_id in " + applicationTypes.toString().replace('[', '(').replace(']', ')'));
        Request request = new Request(session, "/fql", parameters, HttpMethod.GET);
        Response response = request.executeAndWait();
        FacebookRequestError error = response.getError();
        if (error == null) {
            notificationsResponse = parseResponse(response);
        } else {/* w w w  . ja v a2 s.  c  o  m*/
            notificationsResponse = new NotificationsResponse();
        }
    }
    return notificationsResponse;
}

From source file:com.android.volley.toolbox.AndroidAuthenticatorTest.java

@Test
public void goodToken() throws Exception {
    Bundle bundle = new Bundle();
    bundle.putString(AccountManager.KEY_AUTHTOKEN, "monkey");
    when(mAccountManager.getAuthToken(mAccount, "cooltype", false, null, null)).thenReturn(mFuture);
    when(mFuture.getResult()).thenReturn(bundle);
    when(mFuture.isDone()).thenReturn(true);
    when(mFuture.isCancelled()).thenReturn(false);
    Assert.assertEquals("monkey", mAuthenticator.getAuthToken());
}

From source file:com.facebook.notifications.internal.appevents.AppEventsLogger.java

private void logEvent(@NonNull String eventName, @Nullable String campaignIdentifier) {
    if (campaignIdentifier == null || campaignIdentifier.equals("") || fbSDKLogger == null
            || fbSDKLogMethod == null) {
        return;// w  ww  . j  av  a2 s  .  c om
    }

    Bundle parameters = new Bundle();
    parameters.putString(PUSH_CAMPAIGN_KEY, campaignIdentifier);

    try {
        fbSDKLogMethod.invoke(fbSDKLogger, eventName, parameters);
    } catch (Exception ex) {
        Log.w(LOG_TAG, "Failed to invoke AppEventsLogger."
                + "Did you forget to include the Facebook SDK in your application?", ex);
    }
}

From source file:com.normalexception.app.rx8club.task.DeletePmTask.java

@Override
protected void onPostExecute(Void result) {
    try {/*w ww.  ja v  a  2s . co  m*/
        mProgressDialog.dismiss();
        mProgressDialog = null;
    } catch (Exception e) {
        Log.w(TAG, e.getMessage());
    }

    Bundle args = new Bundle();
    args.putString("link", HtmlFormUtils.getResponseUrl());
    args.putBoolean(PrivateMessageInboxFragment.showOutboundExtra, outbound);
    FragmentUtils.fragmentTransaction(sourceFragment.getActivity(), new PrivateMessageInboxFragment(), false,
            false, args);
}

From source file:com.krayzk9s.imgurholo.activities.ImageActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if (getActionBar() != null)
        getActionBar().setDisplayHomeAsUpEnabled(true);
    if (savedInstanceState == null) {
        Intent intent = getIntent();/* www  .j  ava  2 s.  c  o m*/
        Log.d("intent", intent.getExtras().getParcelable("id").toString());
        JSONObject id = ((JSONParcelable) intent.getExtras().getParcelable("id")).getJSONObject();
        try {
            if (id.has("is_album") && id.getBoolean("is_album")) {
                ImagesFragment fragment = new ImagesFragment();
                Bundle bundle = new Bundle();
                bundle.putString("imageCall", "3/album/" + id.getString("id"));
                bundle.putString("id", id.getString("id"));
                JSONParcelable data = new JSONParcelable();
                data.setJSONObject(id);
                bundle.putParcelable("albumData", data);
                fragment.setArguments(bundle);
                FragmentManager fragmentManager = getSupportFragmentManager();
                FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
                fragmentTransaction.replace(R.id.frame_layout, fragment).commitAllowingStateLoss();
            } else {
                SingleImageFragment singleImageFragment = new SingleImageFragment();
                Bundle bundle = new Bundle();
                bundle.putBoolean("gallery", true);
                JSONParcelable data = new JSONParcelable();
                data.setJSONObject(id);
                bundle.putParcelable("imageData", data);
                singleImageFragment.setArguments(bundle);
                FragmentManager fragmentManager = getSupportFragmentManager();
                FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
                fragmentTransaction.replace(R.id.frame_layout, singleImageFragment).commitAllowingStateLoss();
            }
        } catch (JSONException e) {
            Log.e("Error!", e.toString());
        }
    }
}

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

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