ContentValues get - 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 get method.

This code example shows how to use the following methods:get, put
    } 
 
    @SuppressWarnings("nls") 
    private static void adjustDateForIcs(ContentValues values) {
        if (AndroidUtilities.getSdkVersion() >= 14) { 
            if ("1".equals(values.get("allDay"))) {
                values.put("eventTimezone", Time.TIMEZONE_UTC);
            } else { 
                values.put("eventTimezone", TimeZone.getDefault().getID());
            } 
        } 
    } 
} 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:containsKey, get, put, remove
This code example shows how to use the following methods:get, getAsInteger, getAsLong
            boolean badFormat)
            throws ICalendar.FormatException { 
        ICalendar.Component recurrenceComponent =
                new ICalendar.Component("DUMMY", null /* parent */); 
        ICalendar.parseComponent(recurrenceComponent, recurrence);
        ContentValues values = new ContentValues();
        boolean result = RecurrenceSet.populateContentValues(recurrenceComponent, values);
        Log.d("KS", "values " + values);
 
        if (badFormat) {
            assertEquals(result, !badFormat);
            return; 
        } 
        assertEquals(rrule, values.get(android.provider.CalendarContract.Events.RRULE));
        assertEquals(rdate, values.get(android.provider.CalendarContract.Events.RDATE));
        assertEquals(exrule, values.get(android.provider.CalendarContract.Events.EXRULE));
        assertEquals(exdate, values.get(android.provider.CalendarContract.Events.EXDATE));
        assertEquals(dtstart, (long) values.getAsLong(CalendarContract.Events.DTSTART));
        assertEquals(tzid, values.get(android.provider.CalendarContract.Events.EVENT_TIMEZONE));
        assertEquals(duration, values.get(android.provider.CalendarContract.Events.DURATION));

7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:get, put
	 * @param highscore 
	 * @return  
	 */ 
	public long createEntry(String name, String highscore) {
		// TODO Auto-generated method stub 
		ContentValues cv = new ContentValues();
		cv.put(KEY_NAME, name);
		cv.put(KEY_HIGHSCORE, highscore);
		Log.d(TAG, (String) cv.get(KEY_NAME));
		return ourDatabase.insert(DATABASE_TABLE, null, cv);
	} 
 
	/** 
	 * Fetching data from a table. 
	 * @return 
	 */ 
	public ArrayList<String[]> getData() {
 
		String[] columns = new String[] { KEY_NAME, KEY_HIGHSCORE };
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:get, remove
     *            the input ContentValues whose key will be removed 
     * @param key 
     * @return the value 
     */ 
    public static Object extractContentValueItem(ContentValues cv, String key) {
        final Object val = cv.get(key);
        cv.remove(key);
        return val;
    } 
 
    /** 
     * @param authority 
     * @param path 
     * @return a standard content:// uri with the given authority and path 
     */ 
    public static Uri toContentUri(String authority, String path) {
        return Uri.parse("content://" + authority + "/" + path);
    } 
 
    /** 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:containsKey, get, size
        } 
    } 
 
    private void doTestContentValues(ContentValues cv, String key, Object value)
    { 
        assertEquals("ContentValues size", 1, cv.size());
        assertTrue("ContentValues key", cv.containsKey(key));
        assertEquals("ContentValues value", value, cv.get(key));
    } 
    private void doTestNullContentValues(ContentValues cv, String key, boolean expectNull)
    { 
        assertEquals("ContentValues size", expectNull?0:1, cv.size());
        assertEquals("ContentValues key", !expectNull, cv.containsKey(key));
    } 
    private void doTestNullContentValues(ContentValues cv, Field key, boolean expectNull)
    { 
        doTestNullContentValues(cv, key.getAnnotation(Column.class).value(), expectNull);
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:get, getAsInteger, getAsLong
            boolean badFormat)
            throws ICalendar.FormatException { 
        ICalendar.Component recurrenceComponent =
                new ICalendar.Component("DUMMY", null /* parent */); 
        ICalendar.parseComponent(recurrenceComponent, recurrence);
        ContentValues values = new ContentValues();
        boolean result = RecurrenceSet.populateContentValues(recurrenceComponent, values);
        Log.d("KS", "values " + values);
 
        if (badFormat) {
            assertEquals(result, !badFormat);
            return; 
        } 
        assertEquals(rrule, values.get(android.provider.CalendarContract.Events.RRULE));
        assertEquals(rdate, values.get(android.provider.CalendarContract.Events.RDATE));
        assertEquals(exrule, values.get(android.provider.CalendarContract.Events.EXRULE));
        assertEquals(exdate, values.get(android.provider.CalendarContract.Events.EXDATE));
        assertEquals(dtstart, (long) values.getAsLong(CalendarContract.Events.DTSTART));
        assertEquals(tzid, values.get(android.provider.CalendarContract.Events.EVENT_TIMEZONE));
        assertEquals(duration, values.get(android.provider.CalendarContract.Events.DURATION));

5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:containsKey, get
            return defaultValue;
        } 
    } 
 
    public boolean isChanged(String key) {
        if (mAfter == null || !mAfter.containsKey(key)) {
            return false; 
        } 
 
        Object newValue = mAfter.get(key);
        Object oldValue = mBefore.get(key);
 
        if (oldValue == null) {
            return newValue != null;
        } 
 
        return !oldValue.equals(newValue);
    } 
 
    public String getMimetype() {
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:get
	 * Takes in the cursor of information and updates the database for the alarm  
	 * with that id. 
	 */ 
	public boolean saveAlarm(ContentValues values) {
		 
		 return mDb.update(TABLE_NAME, values, "_id=" + values.get("_id"), null) > 0;
	} 
	 
	/* 
	 * Delete the alarm with that id from the database. 
	 */ 
	public void deleteAlarm(long ID) {
		mDb.delete(TABLE_NAME, "_id=" + ID, null);
	} 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:get
    if (db == null) {
      Log.e("CurrentRobotContentProvider", "Could not get the writable database.");
      return null; 
    } 
    db.beginTransaction();
    if (values.get(TABLE_COLUMN) != null) {
      Log.i("CurrentRobotContentProvider", "Saving robot...");
      
      Cursor c = db.query(TABLE_NAME, new String[] {TABLE_COLUMN, },
                          null, new String[] {}, null, null, null);
      if (c.getCount() > 0) {
        Log.i("CurrentRobotContentProvider", "Update currently existing row");
        db.update(TABLE_NAME, values, null, new String[] {});
      } else { 
        Log.i("CurrentRobotContentProvider", "Insert new row");
        if (db.insert(TABLE_NAME, null, values) < 0) {
          Log.e("CurrentRobotContentProvider", "Error inserting row!");
        } 
      } 
    } else { 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related ContentValues get Questions & Answers:

get Method Overview
Gets a value.
See Code Examples for other Android ContentValues Methods: