---
title: "android 当ListView滚动时自动调用 onCheckedChanged 导致CheckBox 状态不停变化"
author: "simplehappy"
date: "2016-02-24T09:53:40Z"
tags: []
categories: ["移动开发"]
slug: "android-listview-oncheckedchanged-checkbox"
draft: false
lastmod: "2016-03-23T12:38:55Z"
id: 2278410
url: "https://simplehappy.iteye.com/blog/2278410"
---

http://blog.sina.com.cn/s/blog\_93bca7340102uzmq.html

 

final CheckBox cb = (CheckBox)view.findViewById(R.id.checkBox1);

cb.setOnCheckedChangeListener(null);

cb.setChecked(mSelectedItems.getBoolean(id.toString(), false));

cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {......