0
A
回答
0
將PDF的查看交給另一個應用程序(如Adobe Reader)可能是最佳選擇。
使用一個意圖:
Intent i = new Intent(Intent.ACTION_VIEW);
File pdf = new File(FILE_LOCATION);
i.setDataAndType(Uri.fromFile(pdf), "application/pdf");
startActivity(i);
我們還應該考慮如果用戶沒有使用PDF閱讀器的情景:
Intent i = new Intent(Intent.ACTION_VIEW);
File pdf = new File(FILE_LOCATION);
i.setDataAndType(Uri.fromFile(pdf), "application/pdf");
List<ResolveInfo> list = getPackageManager().queryIntentActivities(i,
PackageManager.MATCH_DEFAULT_ONLY);
if(!list.isEmpty()){
startActivity(i);
}else{
Toast.makeText(this, "A PDF reader is required to open this.", Toast.LENGTH_LONG).show();
}
0
First u install the acrobat reader in ur emulator and the u view ur pdf file in emulator. Download acrobat reader apk and install in emulator using this command from command line. 1. Go to start and open run. 2. type cmd and type "adb -e install FilePath" press enter. Then u go to ur application and write this code for viewing pdf in acrobat reader.
Intent i = new Intent(Intent.ACTION_VIEW);
File pdf = new File(<File name whit full path>);
i.setDataAndType(Uri.fromFile(pdf), "application/pdf");
startActivity(i);
相關問題
- 1. UIScrollView顯示空白,滾動觸摸
- 2. 在滾動的sencha觸摸應用中顯示iframe
- 3. 在Android的觸摸屏上觸摸滾動?
- 4. javascript滾動觸摸滾動
- 5. 滾動視圖中的觸摸動作
- 6. 在Ipad中觸摸滾動問題
- 7. 在Java中模擬觸摸滾動
- 8. 在JavaFX中觸摸滾動Gridpane
- 9. 如何在觸摸屏中滾動ListView
- 10. 在xterm.js中禁用觸摸滾動
- 11. 在Sencha觸摸+ Phonegap App中顯示外部圖像/ pdf
- 12. 煎茶觸摸滾動屏上的Android
- 13. 觸摸在durandal + phonegap滾動
- 14. 顯示觸摸
- 15. C#中的winforms觸摸滾動#
- 16. Android觸摸和滾動列表視圖
- 17. Android平滑垂直滾動觸摸
- 18. Android - 滾動時禁用觸摸事件
- 19. 在Android中觸摸並拖動圖像
- 20. 我的ScrollView中的滾動條不會顯示,除非我觸摸ScrollView
- 21. 在Android中顯示類似滾動條的滾動文本
- 22. 使用libgdx觸摸滾動
- 23. 攔截UITableView滾動觸摸
- 24. 滾動SpriteNode使用觸摸
- 25. CorePlot觸摸識別滾動
- 26. N8觸摸滾動lwuit
- 27. 停止UIScrollView觸摸滾動
- 28. Android ListView滾動,觸摸後滾動到頂部
- 29. 如何在Android中觸摸時突出顯示佈局?
- 30. 在mac上滾動的觸摸板
如何使用滾動活動查看下一頁的PDF意圖 –
當pdf查看活動開始顯示在acrobat閱讀器中時。在該視圖中,您可以滾動並查看文件中的所有頁面。打開文件的所有頁面。 –