0

I am trying to retrieve data from below two API requests using retrofit client and want to display in Listview

I am getting response from both below API requests with differenr fields

In below API, coin name, coin price https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest

In below API, logo https://pro-api.coinmarketcap.com/v1/cryptocurrency/info

How to combine both above request responses in separate POJO class?

CoinName.kt data class CoinName( var name: String, var price: String )

CoinInfo.kt data class CoinInfo( var logo: String )

I want to show coin name, coin price, logo fields in my Listview. But coin name and price is present in class CoinName and logo present in CoinInfo class

Techchai Mobile
  • 91
  • 1
  • 1
  • 3
  • Sounds like you need to create a 3rd class that either contains info from the first 2 classes or wraps them. Then populate the list view with instances of the 3rd class. But that solution sounds so obvious that it suggests I am misunderstanding your problem. Perhaps you should show us your attempt, and we can *see* what your problem really is. – Stephen C Jun 01 '19 at 02:10

1 Answers1

1

You need to use zip operator and combine your responses into 3rd class. See this question

Yamko
  • 535
  • 1
  • 3
  • 13