Exemplo n.º 1
0
 private void update() {
   Uri uri = ProjectsProvider.PROJECTS_CONTENT_URI.buildUpon().appendPath("" + id).build();
   String selection = StoryMakerDB.Schema.Projects.ID + "=?";
   String[] selectionArgs = new String[] {"" + id};
   ContentValues values = getValues();
   int count = context.getContentResolver().update(uri, values, selection, selectionArgs);
   // FIXME make sure 1 row updated
 }
Exemplo n.º 2
0
  public void delete() {
    Uri uri = ProjectsProvider.PROJECTS_CONTENT_URI.buildUpon().appendPath("" + id).build();
    String selection = StoryMakerDB.Schema.Projects.ID + "=?";
    String[] selectionArgs = new String[] {"" + id};
    int count = context.getContentResolver().delete(uri, selection, selectionArgs);
    Log.d(TAG, "deleted project: " + id + ", rows deleted: " + count);
    // FIXME make sure 1 row updated

    // TODO should we also delete all media files associated with this project?
  }