2

I am trying to load the image I get from Gallery app. Then I get the URI from the data.getData().getPath(). I get the path which looks like this:

file:///-1/1/content%3A/media/external/file/10393/ORIGINAL/NONE/453874796

What kind of path is this? What is it called?

However when I pass it to Picasso for loading the image from this path, I get exception.

execption: /-1/1/content:/media/external/file/10393/ORIGINAL/NONE/453874796: open failed: ENOENT (No such file or directory)

How can I load the image from this path? Here is the code:

Picasso picasso = new Picasso.Builder(getContext())
                .listener(new Picasso.Listener() {
                    @Override
                    public void onImageLoadFailed(Picasso picasso, Uri uri, Exception exception) {
                        //Here your log
                        Log.e("error", "uri: "+ uri +" execption: "+ exception.getLocalizedMessage());
                    }
                }).build();

        picasso
                .load(new File(path))
                .into(mProfileImage);

All the permissions have been granted to the app.

user2498079
  • 2,872
  • 8
  • 32
  • 60

0 Answers0