【问题标题】:How can I find a specific record in a ListView?如何在 ListView 中找到特定记录?
【发布时间】:2012-02-16 05:12:39
【问题描述】:

假设我有一个 Cursor,其中有 50 条记录,它使用 ViewBinder 绑定到 ListView。我想找到一个特定的行(例如:_id35)并确保该记录在 android 设备上对用户可见。这可能吗?

【问题讨论】:

    标签: android android-listview simplecursoradapter android-viewbinder


    【解决方案1】:

    find a specific row 是什么?您可以调用Cursor c = (Cursor) adapter.getItem(position) 来获取指向用户选择位置的光标。然后你可以像cursor.getString(cursor.getColumnIndexOrThrow("columnName"))这样检索数据。

    【讨论】:

      猜你喜欢
      • 2021-11-02
      • 2015-09-27
      • 2016-09-14
      • 1970-01-01
      • 1970-01-01
      • 2021-02-23
      • 2012-01-03
      • 2019-05-03
      • 2020-06-24
      相关资源
      最近更新 更多