I'm trying to open a PDF file out of my Android application using Adobe Reader. When my code gets excecuted, the Adobe Reader opens but throws the following error:'Error: The document path is not valid' The file blabla.pdf is in my Application rootfolder
String filename = "blabla.pdf";
File file = new File(filename);
Uri internal = Uri.fromFile(file);
Intent target = new Intent(Intent.ACTION_VIEW);
target.setDataAndType(internal, "application/pdf");
target.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent = Intent.createChooser(target, "Open File");
try {
startActivity(intent);
} catch (ActivityNotFoundException e) {
Toast.makeText(this, "U hebt geen PDF viewer geïnstalleerd op dit toestel. " +
"Ga naar de app store en download een PDF viewer om dit bestand te openen.", Toast.LENGTH_LONG).show();
}
startActivity(intent);
I want to use internal storage, not external storage. I've used this example: Link and didn't really understand these 2 examples: Link1 and Link2