Code example for ContentProvider

Methods: update

0
		 */ 
		@Override 
		public int updateItem(SQLiteDatabase db, ContentProvider provider, Uri uri, ContentValues values, String where, String[] whereArgs){
			int count;
			if (mToContentUri != null){
				count = provider.update(ContentUris.withAppendedId(mToContentUri, ContentUris.parseId(uri)), values, where, whereArgs);
			}else{ 
				count = db.update(mToTable, values, ProviderUtils.addExtraWhere(where, BaseColumns._ID+"=?"), ProviderUtils.addExtraWhereArgs(whereArgs, uri.getLastPathSegment()));
			} 
 
			return count;
		} 
 
		// TODO does not yet verify a relationship. 
		@Override 
		public int updateDir(SQLiteDatabase db, ContentProvider provider, Uri uri, ContentValues values, String where, String[] whereArgs){
			int count;
			if (mToContentUri != null){
				count = provider.update(mToContentUri, values, where, whereArgs);
			}else{ 
				count = db.update(mToTable, values, where, whereArgs);