java如何使用Adobe reader独家打开PDF文件? 1 周,5 日 Questions & Answers 625 在我的方法viewPDF()中,我如何编写代码以仅使用Adobe reader而不使用其他PDF应用程序打开PDF 提前谢谢
# 1 楼答案 试试这个 try { Intent intent = new Intent(); intent.setPackage("com.adobe.reader"); intent.setDataAndType(Uri.parse(myFile), "application/pdf"); startActivity(intent); } catch (ActivityNotFoundException activityNotFoundException) { final String appPackageName = "com.adobe.reader"; try { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName))); } catch (android.content.ActivityNotFoundException anfe) { startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName))); } }
# 1 楼答案
试试这个