2013-06-22 41 views
0

我與Android合作,我想打開PDF文件:從URL打開PDF在Android應用程序

  1. 從內部存儲URL
  2. (這裏把我的文件到Android看懂了嗎?)

有人能幫助我嗎?

+0

希望這可能會幫助您http://stackoverflow.com/a/14578661/1450401 – edwin

回答

3

假設有安裝在設備

要在應用程序中使用打開PDF中的PDF查看器應用程序:

Uri path = Uri.fromFile(file); 
Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setDataAndType(path, "application/pdf"); 
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); 
startActivity(intent); 

這裏的文件是PDF文件的路徑。

+0

@ChrisStratton謝謝我已編輯答案 – Ayush

+1

如果我的手機沒有安裝pdf查看器應用程序呢? –

相關問題