in Android the system does not scan flac lossless audio files, so I write a scanner to scan them, put into Audio.Media.EXTERNAL_CONTENT_URI, and it works well – until the MediaScanner activates and delete the entries I have inserted.
Is there a way to prevent MediaScanner deletes them, or some trick to know when MediaScanner is done, so I can call my scanner up to scan and insert again?
Thanks!
in Android the system does not scan flac lossless audio files, so I write
Share
You can check if the MediaScanner is done scanning your sd card by adding BroadcastReceiver to your code which handles ACTION_MEDIA_SCANNER. For the sample code, you can refer to the link below.
Initialize MediaScanner at Beginning of Android Program
With regards to FLAC file not being recognized by MediaScanner, you need to add the file’s mimetype and extension to the /android/frameworks/base/media/java/android/media/MediaFile.java.