解决方案 »
- android+win7+eclipse juno sdcard 导入文件 permission denied
- Activity背景不管怎么设置都不行
- 关于android提取sdcard图片的问题
- eclipse每次运行Android项目都会重启虚拟机
- 手游
- JNI多线程中findclass怎么用找自定义的类
- 服务器端如何及时的响应android客户端的请求?类似短信的,怎么实现?
- android拍照程序的问题
- 有对光线传感器或cmos摄像头熟悉的吗?
- android9.0无法连接指定wifi
- 安卓跑马灯效果产生停顿问题
- (LinearLayout)findViewById(R.id.sec)空指针肿么破
@Override
public void onItemClick(AdapterView<?> l, View v, int position, long id) {
LinearLayout view1 = (LinearLayout) l.getChildAt(position);//实际不是滑动到最后,只要往上滑动一个就会出错。listview的item复用问题。没滚动没报错是因为刚好有一屏幕对应的布局。LinearLayout view1 = (LinearLayout) v;
RelativeLayout view = (RelativeLayout) view1.getChildAt(1); //滑动到底点击,程序崩溃之后显示这一行有错。。不知道为什么
CheckBox checkBox = (CheckBox) view.getChildAt(4);
checkBox.toggle();
System.out.println("clickPosition " + position);
// HideApplicationInfoAdapter.getIsSelected().put(position,
// checkBox.isChecked());
}
};
this.appIcon = (ImageView) view.findViewById(R.id.imgApp);
this.tvAppLabel = (TextView) view.findViewById(R.id.tvAppLabel);
this.tvPkgName = (TextView) view.findViewById(R.id.tvPkgName);
this.checkBox = (CheckBox) view.findViewById(R.id.checkBox1);
}
去抓取各個view的這段應該不能只在convertview=null的時候執行,這樣會重複一直用到一樣的item去放資料,
這段應該每次getview()都必須做一次詳細點說
findviewbyId的動作應該移到這段前面
AppInfo appInfo = (AppInfo) getItem(position);
holder.appIcon.setImageDrawable(appInfo.getAppIcon());....