如何prevent"完整的操作使用和QUOT;在打开使用Adobe Reader对PDF文件。 [英] How to prevent "complete action using" while opening pdf file using Adobe Reader.

查看:232
本文介绍了如何prevent"完整的操作使用和QUOT;在打开使用Adobe Reader对PDF文件。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用安装Adobe Reader打开PDF文件。我试着按以下方式prevent完成操作使用菜单。

I want to open pdf file using installed adobe reader. I tried in the following way to prevent "Complete action using" menu.

Intent intent = new Intent();
intent.setPackage("com.adobe.reader");
intent.setDataAndType(Uri.fromFile(doc), "application/pdf");
startActivity(intent);

使用上述codeI管理,以减少列表大小为2。有什么办法来避免显示上下文菜单(完整的操作使用)。

Using the above code i managed to reduce the list size to 2. Is there any way to avoid showing context menu (Complete action using).

感谢您!

推荐答案

我想感谢每一个谁试图回答这个问题。一些浏览后,我发现我的问题的解决方案。这是完全为我工作。

I would like to thanks every one who tried to answer this question. After some browsing i found solution for my Question. which is perfectly working for me.

intent.setPackage("com.adobe.reader");

我用

intent.setClassName("com.adobe.reader", "com.adobe.reader.AdobeReader");

不要忘了启动try catch块的活动,它有助于当设备没有安装Adobe Reader。请检查下面的代码片段。

don't forget to start activity in try catch block, it helps when adobe reader not installed on Device. Please check the below snippet.

try {
    Intent intent = new Intent();

    intent.setClassName("com.adobe.reader", "com.adobe.reader.AdobeReader");
    intent.setAction(Intent.ACTION_VIEW);
    intent.setDataAndType(Uri.fromFile(doc), "application/pdf");
    startActivity(intent);

   } 
   catch (ActivityNotFoundException activityNotFoundException) {
    activityNotFoundException.printStackTrace();
    }

这篇关于如何prevent"完整的操作使用和QUOT;在打开使用Adobe Reader对PDF文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆