Bundle putDouble - 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 putDouble method.

This code example shows how to use the following methods:getDouble, putDouble
    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 
  public void testBoolean() { 
    bundle.putBoolean("foo", true);
    assertEquals(true, bundle.getBoolean("foo"));
    assertEquals(false, bundle.getBoolean("bar"));
    assertEquals(true, bundle.getBoolean("bar", true));
  } 
 
  @Test 
8
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getDouble, putDouble
        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 
    public void testBoolean() { 
        bundle.putBoolean("foo", true);
        assertEquals(true, bundle.getBoolean("foo"));
        assertEquals(false, bundle.getBoolean("bar"));
        assertEquals(true, bundle.getBoolean("bar", true));
    } 
 
    @Test 
8
CodeRank
Contextual code suggestions in your IDE  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
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putDouble
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, double value) {
    extras.putDouble(key, value);
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, float value) {
    extras.putFloat(key, value);
    return realIntent;
  } 
 
  @Implementation 
  public Intent putExtra(String key, long value) {
    extras.putLong(key, value);
    return realIntent;
  } 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putDouble, putParcelable
    /** 
     * Overridden to save instance state when device orientation changes. This method is called automatically if you assign an id to the RangeSeekBar widget using the {@link #setId(int)} method. Other members of this class than the normalized min and max values don't need to be saved. 
     */ 
    @Override 
    protected Parcelable onSaveInstanceState() {
        final Bundle bundle = new Bundle();
        bundle.putParcelable("SUPER", super.onSaveInstanceState());
        bundle.putDouble("MIN", normalizedValue);
        return bundle;
    } 
 
    /** 
     * Overridden to restore instance state when device orientation changes. This method is called automatically if you assign an id to the RangeSeekBar widget using the {@link #setId(int)} method. 
     */ 
    @Override 
    protected void onRestoreInstanceState(Parcelable parcel) {
        final Bundle bundle = (Bundle) parcel;
        super.onRestoreInstanceState(bundle.getParcelable("SUPER"));
        normalizedValue = bundle.getDouble("MIN");
    } 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putDouble, remove
     */ 
    public Request put(String name, double value) {
        removeFromRequestData(name);
        mParamList.add(name);
        mTypeList.add(TYPE_DOUBLE);
        mBundle.putDouble(name, value);
        return this;
    } 
 
    /** 
     * Add a String 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, String value) {
        removeFromRequestData(name);
        mParamList.add(name);
        mTypeList.add(TYPE_STRING);

6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putDouble
        return realIntent;
    } 
 
    @Implementation 
    public Intent putExtra(String key, double value) {
        extras.putDouble(key, value);
        return realIntent;
    } 
 
    @Implementation 
    public Intent putExtra(String key, float value) {
        extras.putFloat(key, value);
        return realIntent;
    } 
 
    @Implementation 
    public Intent putExtra(String key, long value) {
        extras.putLong(key, value);
        return realIntent;
    } 
6
CodeRank
Contextual code suggestions in your IDE  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);
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putDouble
	 *  
	 * @return			This Datum, for chaining 
	 */ 
	public Datum putDouble(DataManager data, Bundle bundle, double value) {
		if (mAccessor == null) {
			bundle.putDouble(mKey, value);
		} else { 
			mAccessor.set(data, this, bundle, value);
		} 
		return this;
	} 
 
	/** 
	 * Retrieve the data from the DataManager, translating and using Accessor as necessary. 
	 *  
	 * @param data		Parent collection 
	 * @param bundle	Raw data 
	 *  
	 * @return			Value of the data 
	 */ 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:putDouble
   * 
   * @param key a String, or null 
   * @param value a double 
   */ 
  public TaskResult add(String key, double value) {
    mBundle.putDouble(key, value);
    return this;
  } 
 
  /** 
   * Inserts a String value into the mapping of this Bundle, replacing any existing value for the 
   * given key.  Either key or value may be null. 
   * 
   * @param key a String, or null 
   * @param value a String, or null 
   */ 
  public TaskResult add(String key, String value) {
    mBundle.putString(key, value);
    return this;
  } 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Bundle putDouble Questions & Answers:

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