Code example for ContentValues

Methods: putAll

	public void addToFavorites(PlaylistEntry entry) {
		SQLiteDatabase db = getDb();
		// put playlistentry data the table 
		ContentValues values = new ContentValues();
		values.putAll(new TrackDatabaseBuilder().deconstruct(entry.getTrack()));
		values.putAll(new AlbumDatabaseBuilder().deconstruct(entry.getAlbum()));
		String[] whereArgs = {""+entry.getTrack().getId()};
		int row_count = db.update(TABLE_FAVORITES, values, "track_id=?", whereArgs);
		if(row_count == 0){
			db.insert(TABLE_FAVORITES, null, values);
Connect your IDE to all the code out there  Get Codota for Java