Reputation: 8118
I've a file in my Download folder called random.txt and I want to display this in my android app. So I thought I could write this code to get the file path and open it:
String path= Environment.getExternalStorageDirectory()
.toString() + File.separator;
openPdfIntent(path + "/Download/random.pdf");
But I get the log message that my file doesn't exist. If I browse to the location with my file manager the file is there.
My phone is a HTC one so I don't have a external sdcard.
Upvotes: 0
Views: 76
Reputation: 8118
I forgot to give permission in my manifest.
That in combination with
String pdfFilePath = Environment.getExternalStorageDirectory()
.toString() + "/Download/random.pdf";
Upvotes: 1
Reputation: 514
try this:
pdfFilePath = "file://" + Environment.getExternalStorageDirectory()
.toString() + "/Download/random.pdf";
Upvotes: 0