Android has a cache that tracks media files.
Try the following:
sendBroadcast(new Intent(Intent.ACTION_MEDIA_MOUNTED, Uri.parse("file://" + Environment.getExternalStorageDirectory())));
This will start the MediaScanner service again, which should remove the deleted song from the device’s cache.
You also need to add this permission to your AndroidManifest.xml:
<intent-filter> <action android:name="android.intent.action.MEDIA_MOUNTED" /> <data android:scheme="file" /> </intent-filter>
Marc bernstein
source share