解决在华为手机获取的图片列表中部分图片不能被获取到

 /**
     * @param img
     */
    private void SelectUserImage(ImageView img) {
        //打开手机的图库;
//        intent = new Intent();
//        intent.setType("image/*");
//        intent.setAction(Intent.ACTION_GET_CONTENT);
        //上面的写法在华为手机中获取的图片列表中部分图片不能被获取到
        Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
        intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
                "image/*");
        startActivityForResult(intent, CHOOSE_PICTURE);
    }

你可能感兴趣的:(Android应用研发)