2011-04-15 73 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(); 
}