Выводятся удаленные папки Music аудио
Есть код, который сохраняет аудиопоток в папку Music/myfolder. Где Music - этот папка для музыки по умолчанию. Файл создается корректно, но когда файл удаляю вручную, метод, который описан ниже все равно выводит его как будто файл есть в папке. Почему?
PS - поиск идет по всем файлам, которые содержат в названии "myaudios".
private void parseAllAudio(String type) {
try {
String TAG = "ТЕСТ";
Cursor cur = getContentResolver().query(MediaStore.Audio.Media.EXTERNAL_CONTENT_URI, null, MediaStore.Audio.Media.DATA + " like ? ", new String[]{"%" + "myaudios" + "%"}, null, null);
if (cur == null) {
// Query failed...
Log.e(TAG, "Failed to retrieve music: cursor is null :-(");
}
else if (!cur.moveToFirst()) {
// Nothing to query. There is no music on the device. How boring.
Log.e(TAG, "Failed to move cursor to first row (no query results).");
}else {
Log.i(TAG, "Listing...");
// retrieve the indices of the columns where the ID, title, etc. of the song are
// add each song to mItems
do {
mediaList.add(cur.getString(cur.getColumnIndex(MediaStore.Audio.Media.DATA)));
} while (cur.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
}
for (String s : mediaList) {
System.out.println(s + " --------------------------");
}
}