开发者

Refresh gallery on Android 7 downwards?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜