I’m having some trouble getting the adobe reader app to open a pdf in my sdcard…
This is what I’m currently trying.
Intent intent = new Intent(Intent.ACTION_VIEW);
String aux = Environment.getExternalStorageDirectory() + "/mhtemp/jazz.pdf";
intent.setDataAndType(Uri.parse(aux), "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {
startActivity(intent);
}
catch (ActivityNotFoundException e) { continues....
When I go ahead and do this I get a notification from adobe reader that reads “The file could not be opened.” Still, I checked with a fileviewer and the file is indeed there, in the folder I created. And most of all, if I try to open it from the fileviewer, it works! I don’t know what I’m doing wrong with the intent here…
Try converting your file path to a Uri properly like so: