Android Bitmap是不能比较的,这样做是错误的
代码1:
Bitmap dir = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_search_list_img);
Bitmap doc = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_word_file);
Bitmap xls = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_excel_file);
Bitmap ppt = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_ppt_file);
Bitmap jpg = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_img_file);
Bitmap zip = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_zip_file);
Bitmap voc = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_none_file);
Bitmap none = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_none_file);
if(dir.equals(mMySkydriveList.get(i).getNetdiscListImgs())){
tmpObj.put("ext", "");
}else if(doc.equals(mMySkydriveList.get(i).getNetdiscListImgs())){
tmpObj.put("ext", "");
}else if(xls.equals(mMySkydriveList.get(i).getNetdiscListImgs())){
tmpObj.put("ext", "");
}else if(ppt.equals(mMySkydriveList.get(i).getNetdiscListImgs())){
tmpObj.put("ext", "");
}else if(jpg.equals(mMySkydriveList.get(i).getNetdiscListImgs())){
tmpObj.put("ext", "");
}else if(zip.equals(mMySkydriveList.get(i).getNetdiscListImgs())){
tmpObj.put("ext", "");
}else if(voc.equals(mMySkydriveList.get(i).getNetdiscListImgs())){
tmpObj.put("ext", "");
}else if(none.equals(mMySkydriveList.get(i).getNetdiscListImgs())){
tmpObj.put("ext", "");
}
代码2:
/**
* 增加文件夹图片
* */
if (mExt.equals("")) {
Bitmap dir = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_search_list_img);
mMySkydriveItem.setNetdiscListImgs(dir);
} else if (mExt.equals("")) {
Bitmap doc = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_word_file);
mMySkydriveItem.setNetdiscListImgs(doc);
} else if (mExt.equals("")) {
Bitmap xls = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_excel_file);
mMySkydriveItem.setNetdiscListImgs(xls);
} else if (mExt.equals("")) {
Bitmap ppt = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_ppt_file);
mMySkydriveItem.setNetdiscListImgs(ppt);
} else if (mExt.equals("")) {
Bitmap jpg = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_img_file);
mMySkydriveItem.setNetdiscListImgs(jpg);
} else if (mExt.equals("")) {
Bitmap zip = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_zip_file);
mMySkydriveItem.setNetdiscListImgs(zip);
} else if (mExt.equals("")) {
Bitmap voc = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_none_file);
mMySkydriveItem.setNetdiscListImgs(voc);
} else if (mExt.equals("")) {
Bitmap none = BitmapFactory.decodeResource(context.getResources(), R.drawable.netdisc_none_file);
mMySkydriveItem.setNetdiscListImgs(none);
}
Android Bitmap是不能比较的,这样做是错误的的更多相关文章
- [翻译]开发文档:android Bitmap的高效使用
内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...
- Android Bitmap 全面解析(四)图片处理效果对比 ...
对比对象: UIL Volley 官方教程中的方法(此系列教程一里介绍的,ImageLoader的处理方法和官方的差不多) -------------------------------------- ...
- Android 中加载几百张图片做帧动画防止 OOM 的解决方案
Android 中加载几百张图片做帧动画防止 OOM 的解决方案 最近,项目中有个需求:就是要做一个帧动画,按理说这个是很简单的!但是我能说这个帧动画拥有几百张图片吗?...... 填坑一 ---帧动 ...
- Android Bitmap变迁与原理解析(4.x-8.x)
App开发不可避免的要和图片打交道,由于其占用内存非常大,管理不当很容易导致内存不足,最后OOM,图片的背后其实是Bitmap,它是Android中最能吃内存的对象之一,也是很多OOM的元凶,不过,在 ...
- Android Bitmap 和 ByteArray的互相转换
Android Bitmap 和 ByteArray的互相转换 移动平台图像处理,需要将图像传给native处理,如何传递?将bitmap转换成一个 byte[] 方便传递也方便cpp代码直接处理图像 ...
- Android——BitMap(位图)相关知识总结贴
Android中文API(136) —— Bitmap http://www.apkbus.com/android-54644-1-1.html Android 4.0 r1 API—Bitmap(S ...
- android bitmap out of memory总结、心得
setImageBitmap或setImageResource或BitmapFactory.decodeResource来设置一张大图,这些函数在完成decode后,最终都是通过java层的creat ...
- 36、Android Bitmap 全面解析
Android Bitmap 全面解析(一)加载大尺寸图片 http://www.eoeandroid.com/thread-331669-1-1.html Android Bitmap 全面解析(二 ...
- Android bitmap图片处理
一.View转换为Bitmap 在Android中所有的控件都是View的直接子类或者间接子类,通过它们可以组成丰富的UI界面.在窗口显示的时候Android会把这些控件都加载到内存中 ...
- Android Bitmap 载入与像素操作
Android Bitmap 载入与像素操作 一:载入与像素读写 在Android SDK中,图像的像素读写能够通过getPixel与setPixel两个Bitmap的API实现. Bitmap AP ...
随机推荐
- Atom编辑器入门到精通(一) 安装及使用基础
为什么选择使用Atom Atom是GitHub推出的一款编辑器,被称为21世纪的黑客编辑器,主要的特点是现代,易用,可定制.我之前用过多款编辑器,现在来总结一下个人对各编辑器的看法: Vim是我用的时 ...
- Bye 14 Hello 15
打开博客.空间 窥探到大家都在写自己的2014,抬头一看日历2015已近在咫尺了,看着别人的成长(例如 今年看了多少书.做了什么项目.工资涨了多少.职位角色的变化.去了多少地方.还有一些发善 ...
- SQL 有父标识的 递归查询
递归查询,临时表的高级应用 WITH temp AS ( --父项 SELECT * FROM Ar_Area WHERE Ar_Parent = UNION ALL --递归结果集中的下级 SELE ...
- Solr使用初探——SolrJ的使用
二.SolrJ的使用 SolrJ覆盖了solr的全部功能,下面将自己在实际开发中所使用的程序粘贴出来并适当加以解释,由于本人比较菜,代码书写不是那么的精练,还请见谅. 1. 创建solrserver ...
- struts2自定义类型转换器
首先,何为struts2的类型转换器? 类型转换器的作用是将请求中的字符串或字符串数组参数与action中的对象进行相互转换. 一.大部分时候,使用struts2提供的类型转换器以及OGNL类型转换机 ...
- 飞锐GIS开发基础系列
3s知识库和GIS科研站,未经允许,禁止任何形式的复制.转载和传播.联系方式:276888624@qq.com 品GIS,品开发,品人生...... http://www.3sbase.com/3sb ...
- 自己在使用的English词典
一.ESL/非母语词典 二.EFL/母语词典 1.American Heritage Dictionary 2.World Book Dictionary 3.Oxford Dictionary of ...
- (转)Libevent(4)— Bufferevent
转自:http://name5566.com/4215.html 参考文献列表:http://www.wangafu.net/~nickm/libevent-book/ 此文编写的时候,使用到的 Li ...
- HTML知识点纲要(1)
什么是 HTML?HTML,全称是Hyper Text Markup Language,即超文本标记语言.是用来描述网页的一种标记语言. HTML 标签HTML标签是由尖括号包围的关键词,通常成对出现 ...
- 【转】PFILE和SPFILE介绍
原文:http://blog.sina.com.cn/s/blog_77bba23901017xcl.html 一.PFILE Pfile(Parameter File,参数文件)是基于文本格式的参数 ...