I am currently using the below code to open PDF files. When I try, it is not providing the URI. I am using with manage external storage.
public Intent getFileChooser() {
String folderPath = Environment.getExternalStorageDirectory() + "/";
Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
Uri myUri = Uri.parse(folderPath);
intent.setDataAndType(myUri, mContext.getString(R.string.pdf_type));
return Intent.createChooser(intent, mContext.getString(R.string.merge_file_select));
}
Below is the code I am using on activity result. This option is not providing the uri of the file.
mUri = data.getData();
//Getting Absolute Path
String path = RealPathUtil.getInstance().getRealPath(getContext(), data.getData());
setTextAndActivateButtons(path);
Please help on fixing the issue.