Android之通过ContentResolver获取手机图片和视频的路径和生成缩略图和缩略图路径

1 问题

获取手机所有图片和视频的路径和生成图片和视频的缩略图和缩略图路径

生成缩略图我们用的系统函数

            public static Bitmap getThumbnail(ContentResolver cr, long origId, int kind, Options options) {
                throw new RuntimeException("Stub!");
            }

调用如下

MediaStore.Images.Thumbnails.getThumbnail

 

 

 

 

 

2 获取手机所有视频测试代码

    /**
     *get system orignal Thumbnail
     **/
    private String getVideoSystemThumbnail(Content content, String id) {
        String thumbnail = "";
        ContentResolver cr = content.getContentResolver();
        Cursor cursor = cr.query(
                MediaStore.Video.Thumbnails.EXTERNAL_CONTENT_URI,
                new String[]{
                        MediaStore.Video.Thumbnails.DATA
                },
                MediaStore.Video.Thumbnails.VIDEO_ID + "=" + id,
                null,
         

你可能感兴趣的:(Andriod,积累)