Code example for ContentProvider

Methods: insert

0
 
  @Implementation 
  public final Uri insert(Uri url, ContentValues values) {
    ContentProvider provider = getProvider(url);
    if (provider != null) {
      return provider.insert(url, values);
    } else { 
      InsertStatement insertStatement = new InsertStatement(url, new ContentValues(values));
      insertStatements.add(insertStatement);
      return Uri.parse(url.toString() + "/" + nextDatabaseIdForInserts++);
    } 
  } 
 
  @Implementation 
  public int update(Uri uri, ContentValues values, String where, String[] selectionArgs) {
    ContentProvider provider = getProvider(uri);
    if (provider != null) {
      return provider.update(uri, values, where, selectionArgs);
    } else { 
      UpdateStatement updateStatement = new UpdateStatement(uri, new ContentValues(values), where, selectionArgs);
      updateStatements.add(updateStatement);