how to populate a listview asynchronously?

后端 未结 6 956
说谎
说谎 2020-12-29 07:03

I am wondering how I should implement a ListAdapter that loads its views asynchronously into a ListView? I want to do this because I am populating

6条回答
  •  情深已故
    2020-12-29 07:31

    With Kotlin and the Kotlin extension libraries, this task has gotten way easier. You can use the doAsync/uiThread construct in a library called Anko with a fraction of the code. In the link tutorial below I use this library to populate a ListView with stock quotes calling a REST API Asynchronously with Kotlin. Kotlin is fully integrated into Android Studio:

    http://www.todroid.com/creating-a-stock-pricing-application-with-kotlin-for-android/

提交回复
热议问题