在我的應用我創建的內部應用程序文件(數據/數據/包/文件),我想,當我使用此代碼閱讀這些文件能夠讀取PDF文件:如何從內部存儲器使用其他應用程序讀取pdf文件?
Uri path = Uri.fromFile(pdfFile);
Intent pdfIntent = new Intent(Intent.ACTION_VIEW);
pdfIntent.setDataAndType(path, "application/pdf");
pdfIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
我看了一下使用openOutputStream()方法,但我不知道如何閱讀他們通過this.Could任何人都可以幫助我?
編輯
pdfFile--
File directory=getFilesDir();
pdfFile=new File(directory,filename+".pdf");
也有相同的問題http://stackoverflow.com/questions/10299839/how-to-read-pdf-in-my-android-application – MAC 2012-04-25 09:05:17
你的'pdfFile'字符串包含什麼? – Pallavi 2012-04-25 09:15:19
@Plalavi - 文件目錄= getFilesDir(); \t pdfFile = new File(directory,filename +「。pdf」); – Navdroid 2012-04-25 09:57:40