开发者

Refresh gallery on Android 7 downwards?

开发者 https://www.devze.com 2023-03-30 15:11 出处:网络
I can use MediaScannerConnection.scanFile() as of SDK 2.2+. After taking an image and saving开发者_如何学Python it on the sd card, how can I trigger scanning of images in SDKs lower than 2.2 (2.1 do

I can use MediaScannerConnection.scanFile() as of SDK 2.2+.

After taking an image and saving开发者_如何学Python it on the sd card, how can I trigger scanning of images in SDKs lower than 2.2 (2.1 downwards)?


There are two MediaScannerConnection.scanFile(..) methods. Use the one available since API 1.

// available since API 1
scanFile (String path, String mimeType)  

// available since API 8
scanFile (Context context, String[] paths, String[] mimeTypes, MediaScannerConnection.OnScanCompletedListener callback)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号