Code example for ContentValues

Methods: putputAll

0
		if (mDb == null) {
			// database was not created 
			return false; 
		} 
		// put playlistentry data the table 
		ContentValues values = new ContentValues();
 
		values.put("downloaded", 0);
		values.putAll(new TrackDatabaseBuilder().deconstruct(entry.getTrack()));
		values.putAll(new AlbumDatabaseBuilder().deconstruct(entry.getAlbum()));
 
		String[] whereArgs = { "" + entry.getTrack().getId() };
		long row_count = mDb.update(TABLE_LIBRARY, values, "track_id=?",
				whereArgs);
 
		if (row_count == 0) {
			mDb.insert(TABLE_LIBRARY, null, values);
		} 
 
		return row_count != -1l;
	}