0

在我的 android 中,我安装了 Adob​​e PDF 阅读器。现在我要做的是,当我的 PDF 被下载并显示 PDF 被点击时,我试图在 Adob​​e PDF 阅读器中打开 PDF。

以下是 Adob​​e PDF Reader Comes 的意图,但没有选项:

public String showPdf(String fileName) {
File file = new File(fileName);
Log.i("PdfViewer", "open file "+ fileName);
// if (file.exists()) {
Log.i("PdfViewer", "file exist");
try {
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//intent.setData(Uri.parse(fileName));
this.ctx.startActivity(intent);
return "";
} catch (android.content.ActivityNotFoundException e) {
System.out.println("PdfViewer: Error loading url "+fileName+":"+ e.toString());
return e.toString();
}

你能建议一个使用意图吗?

谢谢,安基特。

4

0 回答 0