ContentValues getAsBoolean - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getAsBoolean
		assertTrue(b.get());
	} 
	 
	public void testPutData() { 
		BooleanField b = new BooleanField();
		ContentValues values = new ContentValues();
		 
		b.set(true);
		b.putData("foo", values);
		 
		assertTrue(values.getAsBoolean("foo"));
	} 
	 
	public void testReset() { 
		BooleanField b = new BooleanField();
		 
		b.set(true);
		assertTrue(b.get());
		 
		b.reset();
7
CodeRank
This code example shows how to use the following methods:getAsBoolean, getAsFloat, getAsString
				} catch (ClassNotFoundException e) {
					Log.e(THIS_FILE, "Impossible to retrieve class from selection");
				} 
			} 
			if (aClass == String.class) {
				prefs.setPreferenceStringValue(name, cv.getAsString(FIELD_VALUE));
			} else if (aClass == Float.class) {
				prefs.setPreferenceFloatValue(name, cv.getAsFloat(FIELD_VALUE));
			} else if (aClass == Boolean.class) {
				prefs.setPreferenceBooleanValue(name, cv.getAsBoolean(FIELD_VALUE));
			} 
			count++;
			break; 
		case RAZ:
			prefs.resetAllDefaultValues();
			break; 
		} 
		return count;
	} 
 
6
CodeRank
This code example shows how to use the following methods:containsKey, getAsBoolean
        return mMimeStreamType;
    } 
 
    @Override 
    public Uri insert(Uri uri, ContentValues values) {
        if (values.containsKey(PREPARE)) {
            if (values.getAsBoolean(PREPARE)) {
                mImageReadyCond.close();
            } else { 
                mImageReadyCond.open();
            } 
        } 
        return null; 
    } 
 
    @Override 
    public int update(Uri arg0, ContentValues arg1, String arg2, String[] arg3) {
        return 0; 
    } 
 
5
CodeRank
This code example shows how to use the following methods:getAsBoolean, getAsInteger, getAsLong, getAsString
        Integer tmp_i;
        String tmp_s;
        Long tmp_l;
        Boolean tmp_b;
         
        tmp_s = args.getAsString(FIELD_FROM);
        if(tmp_s != null) {
            from = tmp_s;
        } 
        tmp_s = args.getAsString(FIELD_TO);
        if(tmp_s != null) {
            to = tmp_s;
        } 
        tmp_s = args.getAsString(FIELD_CONTACT);
        if(tmp_s != null) {
            contact = tmp_s;
        } 
        tmp_s = args.getAsString(FIELD_BODY);
        if(tmp_s != null) {
            body = tmp_s;

5
CodeRank
This code example shows how to use the following methods:getAsBoolean
		this.control = control;
		control.setOnCheckedChangeListener(this);
	} 
 
	public void Load(ContentValues content) {
		Boolean val = content.getAsBoolean(column);
		if (val != null)
			control.setChecked(val);
		else 
			control.setChecked(false);
		modified = false;
	} 
 
	public void Save(ContentValues content) {
		boolean val = control.isChecked();
		content.put(column, val);
	} 
 
	public boolean isModified() { 
		return modified;
5
CodeRank
This code example shows how to use the following methods:getAsBoolean, getAsString
5
CodeRank
This code example shows how to use the following methods:getAsBoolean
			map.put(key, values.get(key));
		return map;
	} 
 
	public boolean getBoolean(String key, boolean defValue) {
		return values.getAsBoolean(key) != null ? values.getAsBoolean(key) : defValue;
	} 
 
	public float getFloat(String key, float defValue) {
		// TODO Auto-generated method stub 
		return 0; 
	} 
 
	public int getInt(String key, int defValue) {
		// TODO Auto-generated method stub 
		return 0; 
	} 
 
	public long getLong(String key, long defValue) {
		// TODO Auto-generated method stub 
5
CodeRank
This code example shows how to use the following methods:getAsBoolean
    } 
 
    ////////// ReadWriteModelHandler ////////// 
 
    @Override public String  getString(String field)    { return mValues.getAsString(field); }
    @Override public Boolean getBoolean(String field)   { return mValues.getAsBoolean(field); }
    @Override public Byte    getByte(String field)      { return mValues.getAsByte(field); }
    @Override public Short   getShort(String field)     { return mValues.getAsShort(field); }
    @Override public Integer getInteger(String field)   { return mValues.getAsInteger(field); }
    @Override public Long    getLong(String field)      { return mValues.getAsLong(field); }
    @Override public Float   getFloat(String field)     { return mValues.getAsFloat(field); }
    @Override public Double  getDouble(String field)    { return mValues.getAsDouble(field); }
    @Override public byte[]  getbyteArray(String field) { return mValues.getAsByteArray(field); }
 
    @Override public void set(String field, String value)  { mValues.put(field, value); }
    @Override public void set(String field, Boolean value) { mValues.put(field, value); }
    @Override public void set(String field, Byte value)    { mValues.put(field, value); }
    @Override public void set(String field, Short value)   { mValues.put(field, value); }
    @Override public void set(String field, Integer value) { mValues.put(field, value); }
    @Override public void set(String field, Long value)    { mValues.put(field, value); }
4
CodeRank
getAsBoolean Method Overview
Gets a value and converts it to a Boolean.
See Code Examples for other Android ContentValues Methods: