代码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是不能比较的,这样做是错误的的更多相关文章

  1. [翻译]开发文档:android Bitmap的高效使用

    内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...

  2. Android Bitmap 全面解析(四)图片处理效果对比 ...

    对比对象: UIL Volley 官方教程中的方法(此系列教程一里介绍的,ImageLoader的处理方法和官方的差不多) -------------------------------------- ...

  3. Android 中加载几百张图片做帧动画防止 OOM 的解决方案

    Android 中加载几百张图片做帧动画防止 OOM 的解决方案 最近,项目中有个需求:就是要做一个帧动画,按理说这个是很简单的!但是我能说这个帧动画拥有几百张图片吗?...... 填坑一 ---帧动 ...

  4. Android Bitmap变迁与原理解析(4.x-8.x)

    App开发不可避免的要和图片打交道,由于其占用内存非常大,管理不当很容易导致内存不足,最后OOM,图片的背后其实是Bitmap,它是Android中最能吃内存的对象之一,也是很多OOM的元凶,不过,在 ...

  5. Android Bitmap 和 ByteArray的互相转换

    Android Bitmap 和 ByteArray的互相转换 移动平台图像处理,需要将图像传给native处理,如何传递?将bitmap转换成一个 byte[] 方便传递也方便cpp代码直接处理图像 ...

  6. Android——BitMap(位图)相关知识总结贴

    Android中文API(136) —— Bitmap http://www.apkbus.com/android-54644-1-1.html Android 4.0 r1 API—Bitmap(S ...

  7. android bitmap out of memory总结、心得

    setImageBitmap或setImageResource或BitmapFactory.decodeResource来设置一张大图,这些函数在完成decode后,最终都是通过java层的creat ...

  8. 36、Android Bitmap 全面解析

    Android Bitmap 全面解析(一)加载大尺寸图片 http://www.eoeandroid.com/thread-331669-1-1.html Android Bitmap 全面解析(二 ...

  9. Android bitmap图片处理

    一.View转换为Bitmap         在Android中所有的控件都是View的直接子类或者间接子类,通过它们可以组成丰富的UI界面.在窗口显示的时候Android会把这些控件都加载到内存中 ...

  10. Android Bitmap 载入与像素操作

    Android Bitmap 载入与像素操作 一:载入与像素读写 在Android SDK中,图像的像素读写能够通过getPixel与setPixel两个Bitmap的API实现. Bitmap AP ...

随机推荐

  1. bootstrap.css.map这个文件有何用处?该怎能使用它?

    . ├── bootstrap.css ├── bootstrap.css.map ├── bootstrap.min.css ├── bootstrap-theme.css ├── bootstra ...

  2. 调试环境部署续:vs远程调试

    原文http://www.bitscn.com/weixin/464994.html 第一步  IIS的配置 进入iis,点击网址,选择你的网站,在窗口的右边编辑网站中点击绑定,如图所示. 进入网站绑 ...

  3. jasper

    package jasper; import java.util.ArrayList;import java.util.HashMap;import java.util.Map; import net ...

  4. Come and join us at English corner

    2012.12.26 Hi all, How are you doing? Merry post-Christmas and happy upcoming New year!! I wish you ...

  5. Windows 7中,用Visual Studio开发WPF应用程序,实现从Windows Explorer中拖拽文件到应用程序,始终显示“无法拖放”符号问题解决方案

    Are you running your application or Visual Studio that hosts the app under administrative privilege? ...

  6. linq 多条件查询 where 拼接+分页

    首先定义一个静态类 public static class QueryAssembly { /// <summary> /// 返回true /// </summary> // ...

  7. WPF动画之线性插值动画(1)

    XAML代码: <Window x:Class="线性插值动画.MainWindow" xmlns="http://schemas.microsoft.com/wi ...

  8. 伪Base16的构思和实现

    最近看见了一个迅雷地址,发现将其转换为普通链接的工具后,发现所谓专用地址地址就是原地址前加一个表示迅雷的前缀,后进行Base64编码.查阅Base64编码过程后,突发奇想:能否做一个Base16算法? ...

  9. == 和 equals()的区别

    package com.liaojianya.chapter1; /** * This program demonstrates the difference between == and equal ...

  10. IOS视图旋转可放大缩小

    - (IBAction)hideBut:(id)sender { if (self.flg) { [UIView animateWithDuration:0.3 animations:^{ self. ...