解决方案 »
- 请问这个变量类型Recognizer 定义在什么文件中?
- 百度,谷歌地图 精确到XX米 这个是怎么实现的?
- 如何在android 的Contact提供的Content provider中插入图片??(苦逼求助)
- Android的UI,长按图标拖曳效果
- s5pv210平台,加载android系统的怪异问题
- 程序运行意外stop,求高人解答!
- 请问如何用java对/cache目录进行读写操作
- 关于线程的问题 急求解答
- 有没有安卓没有安装成功的
- 安卓开发能否使用access数据库
- android怎么创建图片文件??
- 在androidManifest文件中某个activity下设置Theme.NoTitleBar
if (!new File(filePath).exists()) {
continue;
}
if (!new File(filePath).exists()) {
continue;
}
有时是这样的,文件在,但是你没有权限读取,也会导致这样的错误,文件是在哪的?
if (!new File(filePath).exists()) {
continue;
}
有时是这样的,文件在,但是你没有权限读取,也会导致这样的错误,文件是在哪的?
文件在来着权限也有,可以通过另外的方式查看到我好像已经找到可行的解决方法了,正在试,成功了贴出来。。
final Map dataSet = mData.get(position);
if (dataSet == null) {
return;
} final ViewBinder binder = mViewBinder;
final String[] from = mFrom;
final int[] to = mTo;
final int count = to.length; for (int i = 0; i < count; i++) {
final View v = view.findViewById(to[i]);
if (v != null) {
final Object data = dataSet.get(from[i]);
String text = data == null ? "" : data.toString();
if (text == null) {
text = "";
} boolean bound = false;
if (binder != null) {
bound = binder.setViewValue(v, data, text);
} if (!bound) {
if (v instanceof Checkable) {
if (data instanceof Boolean) {
((Checkable) v).setChecked((Boolean) data);
} else if (v instanceof TextView) {
// Note: keep the instanceof TextView check at the bottom of these
// ifs since a lot of views are TextViews (e.g. CheckBoxes).
setViewText((TextView) v, text);
} else {
throw new IllegalStateException(v.getClass().getName() +
" should be bound to a Boolean, not a " +
(data == null ? "<unknown type>" : data.getClass()));
}
} else if (v instanceof TextView) {
// Note: keep the instanceof TextView check at the bottom of these
// ifs since a lot of views are TextViews (e.g. CheckBoxes).
setViewText((TextView) v, text);
} else if (v instanceof ImageView) {
if (data instanceof Integer) {
setViewImage((ImageView) v, (Integer) data);
} else {
setViewImage((ImageView) v, text);
}
} else {
throw new IllegalStateException(v.getClass().getName() + " is not a " +
" view that can be bounds by this SimpleAdapter");
}
}
}
}
}这里面当控件是ImageView的时候,他只分了两种情况,一种是资源ID,一种是文件地址,我传入的数据是Bitmap类型的数据,在这里当然就当成了文件地址来处理,自然就会有FileNotFoundException。知道了原因,解决方案就呼之欲出了,就是自己重写这个类,增加一种情况当数据类型是Bitmap的时候怎么处理,然后就轻松自在的解决了,代码我就不贴了,因为确实没什么好贴的,找到了原因,解决方案实在不值一提