【发布时间】:2011-11-28 06:23:26
【问题描述】:
早安,
我遇到了一个奇怪的问题。我想在android中打开PDF文件......我成功了两个 方式
1)-->First Using API (But that is damn slow)
2)-->第二次使用 ACTION_VIEW。它适用于具有 Quick Office 的手机 代码是
File file = new File("/mnt/sdcard/videosadoce.pdf");
if (file.exists()) {
Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
try {
startActivity(intent);
}
catch (ActivityNotFoundException e) {
Toast.makeText(MyPdfViewer.this,
"No Application Available to View PDF",
Toast.LENGTH_SHORT).show();
}
}
现在我想自定义默认活动启动的视图。我想添加一些动画 在我浏览 PDF 文件页面时,让页面像书一样打开。 那么如何自定义该预定义视图
【问题讨论】:
标签: android actionview pdf-reader pdf-rendering