データベースがあります。デバイス で曲の追加/削除を確認できないため、アプリケーションを起動するたびに曲のテーブルを更新していduplicate of what ever already there in database
ます。質問はhow to insert if any new songs are added
及びremoved the song from database if any old song deleted
。
Cursor cursorSong = this.managedQuery(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI,
projection,selection, null, null);
while (cursor.moveToNext()) {
String sdata = cursor.getString(0);
ContentValues initialValues = new ContentValues();
initialValues.put(KEY_PATH, sdata);
mDB.insert(DataHelper.SONG_TABLE, null,initialValues);
}