What happens to cursors to MediaStore when the underlying database gets updated?
In my app (a small mp3-player for an university project) I'm doing query MediaStore.Audio.Media.EXTERNAL_CONTENT_URI
. Currently, I'm caching the songs to an array, but I'm thinking of moving it over to just using the Cursor
object.
I can see a few problems:
- The underlying database can get updated (the Android device detected a song getting added or removed)
- A song gets removed without the database ge开发者_高级运维tting updated.
For the first point:
- what happens to the cursor when the database gets updated?
- How can I detect when MediaStore gets updated?
For the second point:
- Is the only thing I can do to detect this to try to access the resource and see whether it fails?
精彩评论