本文介绍了notifyDataSetChanged用于多个复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

code>在一个活动中显示SelectAll复选框,在适配器中显示所有复选框
如果i 选中SelectAll ,则在适配器中选中所有复选框,如果取消选中,则取消选中所有复选框。

In attached image, SelectAll checkbox is present with in an activity, and all checkboxes within adapter.If i checked SelectAll then all checkboxes are checked in adapter and if I unchecked then all are unchecked. Its happening nicely.

但我想如果我选中SelectAll ,之后如果i uncheked 一个或多个复选框,然后 SelectAll复选框应取消选中
如果没有勾选SelectAll如果我手动检查适配器中的所有复选框,然后 SelectAll复选框应该自动选中

But I want if I checked SelectAll and after that if i uncheked one or more checkbox in tha adapter then the SelectAll checkbox should unchecked.and if without check to SelectAll If i manually check all the checkboxes in adapter then SelectAll checkbox should checked automatically.

我如何做。

下面是我的代码,

推荐答案

我有我需要的输出,

这篇关于notifyDataSetChanged用于多个复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 21:46