【发布时间】:2009-10-11 13:12:00
【问题描述】:
我正在尝试使用内置的 Android 图像查看器启动写入我的应用程序目录的图像。此图像已写入应用程序目录的不同部分。获取以下文件时:
super.getFilesDir() + "/current.png"
File.exists() 返回 true。
如何启动内置的 Android 图像查看器来查看此文件? 目前我正在做:
File f = new File(super.getFilesDir()+"/current.png");
uri = Uri.parse("file://"+super.getFilesDir()+"/current.png");
startActivity(new Intent(Intent.ACTION_VIEW, uri));
而且它一直在生产:
10-11 13:09:24.367: 信息/活动管理器(564):正在启动 活动:意图{ 行动=android.intent.action.VIEW dat=file:///data/data/com.davidgoemans.myapp/files/current.png 10-11 13:09:24.367: 错误/myapp(2166):异常 发生android.content.ActivityNotFoundException: 未找到处理 Intent { 的活动 行动=android.intent.action.VIEW dat=file:///data/data/com.davidgoemans.myapp/files/current.png }
无论我将 uri 架构更改为什么(例如 content://、file://、media://、image://)。
【问题讨论】: