I am invoking file chooser with the code below:
Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setType("*/*");
startActivityForResult(intent, 1);
In the onActivityResult method I am creating a File object with the path obtained through
File file=new File(data.getData().getPath());
But I observe that the path returned by the method getPath() is not recognized by File class. As a result, file is never read. I have seen few solution on the web but none of them seem to work. Path looks something like this
content:/com.android.providers.media.documents/document/image%3A15651
Am I missing something?
Am testing on a Samsung Galaxy Note 3 (Android 5.1)