public int addMovieToFavs(Movie selectedMovie) { // Update a movie to mark it as a favorite ContentValues contentValues = new ContentValues(); GregorianCalendar cal = new GregorianCalendar(); contentValues.put(MovieEntry.COLUMN_FAVORITE, cal.getTimeInMillis()); String[] selectionArgs = new String[] {selectedMovie.getMovieId()}; return getContentResolver() .update( MovieEntry.CONTENT_URI, contentValues, MovieEntry.COLUMN_MOVIE_ID + " = ? ", selectionArgs); }
public int removeMovieFromFavs(Movie selectedMovie) { String[] selectionArgs = new String[] {selectedMovie.getMovieId()}; return getContentResolver() .delete(MovieEntry.CONTENT_URI, MovieEntry.COLUMN_MOVIE_ID + " = ? ", selectionArgs); }