0
我想通过android设备上安装的本机应用程序打开远程pdf文件。那可能吗 ? 我试图使用MIME类型的意图,但不起作用。我不想使用docs.google.com参考。可能通过原生android应用程序打开远程pdf文件?
有什么建议吗?
对于ref。 :
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(<remote_path>));
intent.setType("application/pdf");
PackageManager pm = getPackageManager();
List<ResolveInfo> activities = pm.queryIntentActivities(intent, 0);
if (activities.size() > 0) {
startActivity(intent);
}
和
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(<remote_pdf>), "application/pdf");
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
为您尝试的内容发布一些代码。 –