私のアンドロイドには、Adobe PDFリーダーがインストールされています。今私がやろうとしているのは、PDF がダウンロードされ、PDF の表示がクリックされたときに、Adobe PDF リーダーで PDF を開こうとしていることです。
以下は意図ですが、Adobe PDF Readerのオプションはありません。
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();
}
使用目的を教えてください。
ありがとう、アンキット。