我的代码是:

File file = new File(docpath);
String mimetype = "application/pdf";

Uri path = Uri.fromFile(file);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(path, mimetype);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);

startActivity(intent);


如果我想使用application / pdf方法
我该怎么办?

最佳答案

Android并不自然支持PDF。您将需要使用开源库。

例如,Android PDF Viewer。
http://code.google.com/p/apv/

09-16 17:31