Bundle putLong - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Bundle putLong method.

This code example shows how to use the following methods:putLong, putParcelable
 
    private final INetworkStatsSession mSession;
    private final Bundle mArgs;
 
    public static Bundle buildArgs(NetworkTemplate template, long start, long end) {
        final Bundle args = new Bundle();
        args.putParcelable(KEY_TEMPLATE, template);
        args.putLong(KEY_START, start);
        args.putLong(KEY_END, end);
        return args;
    } 
 
    public SummaryForAllUidLoader(Context context, INetworkStatsSession session, Bundle args) {
        super(context);
        mSession = session;
        mArgs = args;
    } 
 
    @Override 
    protected void onStartLoading() { 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getLong, putLong
    assertEquals(2, bundle.size());
  } 
 
  @Test 
  public void testLong() { 
    bundle.putLong("foo", 5);
    assertEquals(5, bundle.getLong("foo"));
    assertEquals(0,bundle.getLong("bar"));
    assertEquals(7, bundle.getLong("bar", 7));
  } 
 
  @Test 
  public void testDouble() { 
    bundle.putDouble("foo", 5);
    assertEquals(Double.valueOf(5), Double.valueOf(bundle.getDouble("foo")));
    assertEquals(Double.valueOf(0),Double.valueOf(bundle.getDouble("bar")));
    assertEquals(Double.valueOf(7), Double.valueOf(bundle.getDouble("bar", 7)));
  } 
 
  @Test 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getLong, putLong
        assertEquals(2, bundle.size());
    } 
 
    @Test 
    public void testLong() { 
        bundle.putLong("foo", 5);
        assertEquals(5, bundle.getLong("foo"));
        assertEquals(0,bundle.getLong("bar"));
        assertEquals(7, bundle.getLong("bar", 7));
    } 
 
    @Test 
    public void testDouble() { 
        bundle.putDouble("foo", 5);
        assertEquals(Double.valueOf(5), Double.valueOf(bundle.getDouble("foo")));
        assertEquals(Double.valueOf(0),Double.valueOf(bundle.getDouble("bar")));
        assertEquals(Double.valueOf(7), Double.valueOf(bundle.getDouble("bar", 7)));
    } 
 
    @Test 
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putInt, putLong, putString
 
		mState = GAME_STATE_NOT_STARTED;
	} 
 
	public void saveState(Bundle outState) {
		outState.putLong("id", mId);
		outState.putString("note", mNote);
		outState.putLong("created", mCreated);
		outState.putInt("state", mState);
		outState.putLong("time", mTime);
		outState.putLong("lastPlayed", mLastPlayed);
		outState.putString("cells", mCells.serialize());
 
		mCommandStack.saveState(outState);
	} 
 
	public void restoreState(Bundle inState) {
		mId = inState.getLong("id");
		mNote = inState.getString("note");
		mCreated = inState.getLong("created");
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putLong, putParcelable
     */ 
    public static EditQuickResponseDialog newInstance( 
            QuickResponse quickResponse, long accountId) {
        final EditQuickResponseDialog dialog = new EditQuickResponseDialog();
 
        Bundle args = new Bundle();
        args.putLong("accountId", accountId);
        if (quickResponse != null) {
            args.putParcelable(QUICK_RESPONSE, quickResponse);
        } 
 
        dialog.setArguments(args);
        return dialog;
    } 
 
    @Override 
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        final Context context = getActivity();
        mQuickResponse = (QuickResponse) getArguments().getParcelable(QUICK_RESPONSE);
 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putBoolean, putDouble, putFloat, putInt, putLong
        final Account account2 = new Account("b@example.com", "example.type.2");
        final String authority1 = "testprovider1";
        final String authority2 = "testprovider2";
        final Bundle extras1 = new Bundle();
        extras1.putString("a", "1");
        final Bundle extras2 = new Bundle();
        extras2.putString("a", "2");
        extras2.putLong("b", 2);
        extras2.putInt("c", 1);
        extras2.putBoolean("d", true);
        extras2.putDouble("e", 1.2);
        extras2.putFloat("f", 4.5f);
        extras2.putParcelable("g", account1);
        final int period1 = 200;
        final int period2 = 1000;
 
        PeriodicSync sync1 = new PeriodicSync(account1, authority1, extras1, period1);
        PeriodicSync sync2 = new PeriodicSync(account1, authority1, extras2, period1);
        PeriodicSync sync3 = new PeriodicSync(account1, authority2, extras1, period1);
        PeriodicSync sync4 = new PeriodicSync(account1, authority2, extras2, period2);
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putLong
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, long value) {
    extras.putLong(key, value);
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, Serializable value) {
    extras.putSerializable(key, serializeCycle(value));
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, Parcelable value) {
    extras.putParcelable(key, value);
    return realIntent;
  } 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putBoolean, putLong, putString
    private static final String ARG_SHOULD_END_ACTIVITY = "endActivity";
 
    public static void show(FragmentManager fragmentManager, long groupId, String label,
            boolean endActivity) {
        GroupDeletionDialogFragment dialog = new GroupDeletionDialogFragment();
        Bundle args = new Bundle();
        args.putLong(ARG_GROUP_ID, groupId);
        args.putString(ARG_LABEL, label);
        args.putBoolean(ARG_SHOULD_END_ACTIVITY, endActivity);
        dialog.setArguments(args);
        dialog.show(fragmentManager, "deleteGroup");
    } 
 
    @Override 
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        String label = getArguments().getString(ARG_LABEL);
        String message = getActivity().getString(R.string.delete_group_dialog_message, label);
 
        return new AlertDialog.Builder(getActivity())
                .setIconAttribute(android.R.attr.alertDialogIcon)
8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putBundle, putLong
		if (webViewBridge.saveState(stateBundle) == null) {
			Log.w(TAG, "failed to save webview state");
			return; 
		} 
 
		outState.putBundle(EXTRA_WEBVIEW_STATE, stateBundle);
		 
		if (Build.VERSION.SDK_INT <= 10) {
			Bundle webViewPictureBundle = new Bundle();
			File tmp = new File(mContext.getCacheDir(), WEBVIEW_TMP_FILE + "."
					+ id);
			if (!webViewBridge.savePicture(webViewPictureBundle, tmp))
				Log.w(TAG, "failed to save webview picture");
			outState.putBundle(EXTRA_WEBVIEW_PICTURE, webViewPictureBundle);
			outState.putLong(EXTRA_WEBVIEW_ID, id);
		} 
	} 
} 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:putLong, remove
     */ 
    public Request put(String name, long value) {
        removeFromRequestData(name);
        mParamList.add(name);
        mTypeList.add(TYPE_LONG);
        mBundle.putLong(name, value);
        return this;
    } 
 
    /** 
     * Add a float parameter to the request, replacing any existing value for the given name. 
     * 
     * @param name The parameter name. 
     * @param value The parameter value. 
     * @return This RequestData. 
     */ 
    public Request put(String name, float value) {
        removeFromRequestData(name);
        mParamList.add(name);
        mTypeList.add(TYPE_FLOAT);

6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Bundle putLong Questions & Answers:

putLong Method Overview
Inserts a long value into the mapping of this Bundle, replacing any existing value for the given key.
See Code Examples for other Android Bundle Methods: