相关疑难解决方法(0)

以编程方式从Android的内置Gallery应用程序中获取/选择图像

我正试图在我的应用程序内打开Gallery内置应用程序中的图像/图片.

我有一张图片的URI(图片位于SD卡上).

你有什么建议吗?

android image gallery android-intent

265
推荐指数
12
解决办法
30万
查看次数

在Android的默认图库图像查看器中使用URI打开图像

我已经提取了图像uri,现在我想用Android的默认图像查看器打开图像.甚至更好,用户可以选择用于打开图像的程序.如果您尝试打开文件,File Explorers之类的东西会提供给您.

android android-image

76
推荐指数
7
解决办法
14万
查看次数

如何使用多个操作制作意图

我想显示一个活动选择器,显示可以查看和/或编辑某些数据的所有应用程序.有没有一种简单的方法可以做到这一点,还是我必须实现自己的活动选择器对话框?或许我可以只是亚类Intent?谢谢.

android android-intent

34
推荐指数
1
解决办法
3万
查看次数

打开pdf文件错误:无法访问此文件检查位置或网络,然后重试.Android 6 Marshmallow

我试图从外部存储器获取文件,然后我必须使用意图将该文件发送到pdf阅读器.以前下面的代码工作正常,但安装Android 6(Marshmallow更新)后,我的代码无法正常工作并获取Toast消息

" 无法访问此文件检查位置或网络,然后重试."

(这是由于新的Android运行时权限).我刚尝试了所有的解决方案(内容提供商等,但没有工作)任何解决方案?

 File file = new File(getFilesDir(), "myfile.pdf");
 Intent intent = new Intent(Intent.ACTION_VIEW);
        intent.setDataAndType(Uri.fromFile(file), "application/pdf");
        intent.setFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
        Intent intentChooser = Intent.createChooser(intent, "Choose Pdf Application");
        try {
            startActivity(intentChooser);
        } catch (ActivityNotFoundException e) {
            //com.adobe.reader
            startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=com.adobe.reader")));
        }
Run Code Online (Sandbox Code Playgroud)

android android-6.0-marshmallow

6
推荐指数
3
解决办法
7093
查看次数