【问题标题】:How to get seleceted items from a listView如何从 listView 中获取选定的项目
【发布时间】:2012-10-25 21:27:14
【问题描述】:

我正在尝试找到一种将复选框添加到 ListView 布局的方法,该布局可用于允许用户选择要处理的项目。列表视图通过 SimpleCursorAdapter 使用游标填充。任何人都可以指出描述如何做这样事情的文档的方向。

【问题讨论】:

    标签: android listview checkbox cursor


    【解决方案1】:

    你需要在getView方法中手动管理listview中的选中项。最后,您将获得选定的项目。根据您的需要和舒适度使用 Arraylist 或 hashmap。

    希望对你有所帮助。

    也可以参考这些链接:

    Android ListView with Checkboxes: How to capture checked items?

    Android ListView

    Adding CheckBoxes to a Custom ListView in Android

    how to display all checked items from multiple choice listview

    【讨论】:

      猜你喜欢
      • 2023-03-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-07-05
      • 2011-06-17
      相关资源
      最近更新 更多