简体   繁体   中英

Display data from API to Custom Spinner using Retrofit2 Kotlin/Java

I have an API that have names and photos, i want to display it on my custom spinner using kotlin or java. I tried to write a code that is similar on implementing recycler view but it is not working. Please give me an idea or example how to do it. Thank you so much.

It is a good practice to separate your data from your ui.

In your data, you'll write all about your model, the API requests, etc.

In your presentation, you'll code about the view and you'll just have to call the functions that you coded in your data.

This is just an exemple you could look: https://github.com/asugomez/TP3/tree/main/app/src/main/java/com/example/tp3

Have a nice day :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM