简体   繁体   English

如何使用Adobe Reader专门打开文件PDF?

[英]How open file PDF exclusively with Adobe reader?

in my method viewPDF(), how can i write code to open PDF exclusively with Adobe reader and not with other PDF app? 在我的方法viewPDF()中,如何编写代码以仅使用Adobe Reader而不是其他PDF应用程序专门打开PDF?

Thanks in advance! 提前致谢!

try this 尝试这个

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)));
   }
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在特定程序(Adobe Reader)中打开下载的文件(PDF) - Open downloaded file (PDF) in specific program (Adobe Reader) Java在Adobe Reader中的客户端上打开pdf文件 - java open pdf file on client side in adobe reader 如何从Adobe Reader中的Android应用程序从服务器打开pdf - How to open pdf from server from Android app in Adobe Reader 如何通过iText读取PDF文件并像在Adobe Reader中一样显示它? - How to read PDF file through iText and display it as in Adobe Reader? 如何仅通过应用程序打开文件 - how open a file exclusively with an app 如何使用Adobe Reader Mobile SDK 9开发pdf / epub阅读器? - How to use Adobe Reader Mobile SDK 9 to develop pdf/epub reader? Adobe Acrobat Reader 无法打开 pdf 文件,因为它不是受支持的文件类型或文件已损坏 - Adobe Acrobat Reader could not open pdf file because it is either not a supported file type or because the file has been damaged 如何在Android应用程序中实现Adobe PDF Reader的构建 - how to implement build in adobe pdf reader in android app 从PDF Reader中的原始文件夹中打开pdf文件 - Open pdf file from raw folder in PDF Reader 尝试打开使用iText库创建的PDF时,Adobe Reader在Mac上显示错误 - Adobe reader shows error on mac when trying to open pdf which is created using iText library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM