How to update the `ListView` according to `ArrayList`?

前端 未结 5 471
傲寒
傲寒 2021-01-29 08:37

I have an array of contacts that I am constantly updating. I want my ListView to update with my contacts.

Should I use an Adapter for that? I

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-29 09:40

    use ArrayList instead of Array[], you don't need to initialize size for ArrayList so it is more flexible than Array[]. and it will automatically scale up or down if you add or delete items inside

提交回复
热议问题