2011-04-15 77 views

回答

0

我不认为它有可能在视图中显示它。您将必须制作一个Intent,然后调用外部程序来完成此操作。

File sd = new File("example.pdf"); 
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromFile(sd)); 
intent.setDataAndType(Uri.fromFile(sd), "application/pdf"); 
try { 
    getContext().startActivity(intent); 
} catch(ActivityNotFoundException e){ 
    // Show a message that a PDF viewer is not installed 
    Toast.makeText("No PDF reader available",Toast.LENGTH_LONG).show(); 
}