Android: How to make an adapter with stable ids?

后端 未结 1 1224
北恋
北恋 2021-01-11 10:54

I\'ve made my own custom adapter extended from BaseAdapter to show a listview and so on...

I want it to support single and multi selection, so it must have stable id

1条回答
  •  没有蜡笔的小新
    2021-01-11 11:13

    Override hasStableIds to return true.

    Also the data on your adapter must either override hashCode() or has some kind of id field to be returned on getItemId.

    0 讨论(0)
提交回复
热议问题