UnsupportedOperationException while picking Image from Gallery

91 Views Asked by At

In some cases, when I try to pick Image from gallery I get this error

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

My Code to pick image is as below :

 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();
            }
0

There are 0 best solutions below