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)
精彩评论