I need to get real path of pdf file the user choosed. Here is my code:
Button click:
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("application/pdf");
startActivityForResult(intent, 2);
onActivityResult:
Uri uri = data.getData();
String picturePath = uri.toString();
here is the solution for images,Get filename and path from URI from mediastore, however it does not work for pdf, because there used MediaStore.Images.Media.DATA.