How to trigger MediaScan on Nexus 7?

前端 未结 3 1429
感情败类
感情败类 2020-12-03 12:45

Because I want to make sure the MediaStore has the latest information without having to reboot I\'d like to trigger the MediaScanner using the popular way I found on SO

3条回答
  •  南笙
    南笙 (楼主)
    2020-12-03 13:31

    using the popular way I found on SO

    Faking ACTION_MEDIA_MOUNTED broadcasts has never been an appropriate solution IMHO.

    Any ideas/alternatives?

    Use MediaScannerConnection, such as via its scanFile() static method.

提交回复
热议问题