0

在某些情况下,当我尝试从图库中选择图像时,我会收到此错误

java.lang.UnsupportedOperationException,未知 URI:content://media/external/images/

我选择图像的代码如下:

 try {
                Intent intent = new Intent();
                intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
                startActivityForResult(Intent.createChooser(intent, "Select Image"), PICK_FROM_FILE);
            } catch (ActivityNotFoundException e) {
                e.printStackTrace();
                Toast.makeText(HomeActivity.this, "No Application Found!", Toast.LENGTH_LONG).show();
            } catch (Exception e) {
                e.printStackTrace();
            }
4

0 回答 0