Chinaunix首页 | 论坛 | 博客
  • 博客访问: 254720
  • 博文数量: 170
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1709
  • 用 户 组: 普通用户
  • 注册时间: 2014-05-06 18:01
文章分类

全部博文(170)

文章存档

2016年(11)

2015年(130)

2014年(29)

分类: Java

2015-04-05 20:56:36

在使用迭代器时 不能改变原来的值,不能改变set值  
Iterator it=set.iterator();
          while(it.hasNext())
          {
              String o=(String)it.next();
              res.add("("+o+")");
              res.add("()"+o);
              res.add(o+"()");
             
          }
          set=res;

还有set=res,后两个引用指向同一个值,一改都改

android小问题:
fragment 类有两个 在引用时别引错了

  // if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(
R.layout.colorlist, null);
iamge = (ImageView) convertView.findViewById(R.id.color_image);
title = (TextView) convertView.findViewById(R.id.color_title);
text = (TextView) convertView.findViewById(R.id.color_text);
   //}
   //绘制联系人名称
   title.setText(mContactsName.get(position));
   //绘制联系人号码
   text.setText(mContactsNumber.get(position));
   //绘制联系人头像
   iamge.setImageBitmap(mContactsPhonto.get(position));

convertView 下次调用时是null 其他对象是空 ,会报空指针,要注释if。


阅读(667) | 评论(0) | 转发(0) |
0

上一篇:Valid Parentheses

下一篇:Generate Parentheses

给主人留下些什么吧!~~