Need to quickly extract pictures and video thumbnails to directly access Android.provider.MediaStore.Images.Thumbnails And android.provider.MediaStore.Video.Thumbnails These two databases, you can query the thumbnail.
How do you judge a document? You can traverse the database by cursor, comparing the value of the Internal_content_uri field, which is a URI that holds the full path to the multimedia file on the Android phone's SD card.
Uri Originaluri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
If the video is MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
Contentresolver CR = This.getcontentresolver ();
Cursor Cursor = cr.query (Originaluri, NULL, NULL, NULL, NULL);
if (cursor = = NULL) {
Return
}
For (Cursor.movetofirst ();! Cursor.isafterlast (); Cursor.movetonext ()) {
Long Thumbnailsid = Cursor.getlong (cursor. Getcolumnindex ("_id"));
Bitmap Bitmap = MediaStore.Images.Thumbnails.getThumbnail (CR,
Thumbnailsid, Video.Thumbnails.MICRO_KIND, NULL);
If the video is
Bitmap Bitmap = MediaStore.Video.Thumbnails.getThumbnail (CR,
Thumbnailsid, Video.Thumbnails.MICRO_KIND, NULL);
return bitmap;
}