Dhiraj Gurunule
Dhiraj Gurunule

Reputation: 81

Need absolute file path of selected file using Intent.ACTION_OPEN_DOCUMENT in android pie

I want to get pdf and convert it into base64. use this code to start picker

Intent  intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
            String [] mimeTypes = {"image/*", "application/pdf"};
            intent.setType("*/*");
            intent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes);
            startActivityForResult(intent, 1);

I had used below solution : https://stackoverflow.com/a/41440869/6864437

but it is not working on android pie

getting below error: Request header queries do not support projections, selections or sorting

How to get the Full file path from URI

Upvotes: 0

Views: 296

Answers (1)

Dhiraj Gurunule
Dhiraj Gurunule

Reputation: 81

Solution used : I use input stream (suggested by @blackaaps) to get data from file and create new file which I can use to get full path.

Upvotes: 1

Related Questions