2015-05-29 105 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 –