2015-05-29 101 views

回答

0

你可以使用類似這樣的例子 - 獲取的文件路徑,並打開它作爲一個新的意圖:

// get the file path from the external storage (SD card) 
File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath()+"/yourPdfName.pdf"); 
Intent intent = new Intent(Intent.ACTION_VIEW); 
// set the content type and data of the intent 
intent.setDataAndType(Uri.fromFile(file), "application/pdf"); 
intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); 
// start the intent as a new activity 
startActivity(intent); 
+0

這不會顯示在TxtView PDF文件的內容。 – greenapps

+0

看看這個問題,以顯示它在textView http://stackoverflow.com/questions/25739313/how-can-i-display-a-pdf-document-into-a-textview –