In my application, I create a pdf file in the internal application files (data / data / package / files). I want these files to be readable when I read them with this code:
Uri path = Uri.fromFile(pdfFile);
Intent pdfIntent = new Intent(Intent.ACTION_VIEW);
pdfIntent.setDataAndType(path, "application/pdf");
pdfIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
I read about using the openOutputStream () method, but I have no hint how to read them through this. Can anyone help me?
EDIT
pdfFile -
File directory=getFilesDir();
pdfFile=new File(directory,filename+".pdf");
source
share