Неверная структура запроса для вызова APIAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Неверная структура запроса для вызова API

Сообщение Anonymous »

Вызов API из dazzer API для профиля Atist, но данные не загружаются ArtistProfle RecyclerView
`artistProfileRecyclerView=findViewById(R.id.recyclerViewArtist)
artistProfileRecyclerView.layoutManager=LinearLayoutManager (this@DashBoardActivity)
artistArrayList= arrayListOf()

Код: Выделить всё

    artistProfileRecyclerView.adapter=ArtistsProfileAdapter(artistArrayList,this@DashBoardActivity)

// Retrofit API call for artist profiles
val retrofitBuilderArtist=Retrofit.Builder()
.baseUrl("https://deezerdevs-deezer.p.rapidapi.com/")
.addConverterFactory(GsonConverterFactory.create())
.build()
.create(ArtistProfileApiInterface::class.java)

//call the API to get artist data

val retrofitArtistData=retrofitBuilderArtist.getProductData("artist")

retrofitArtistData.enqueue(object :Callback{
override fun onResponse(call  : Call, response: Response) {
val artistsProfileDataList=response.body()?.data ?:return

for (artist in artistsProfileDataList){

val artistName=artist.title
val artistImage=artist.album.cover_medium

val artistsProfile=ArtistsProfile(artistName,artistImage)
artistArrayList.add(artistsProfile)
}
artistProfileRecyclerView.adapter?.notifyDataSetChanged()
}

override fun onFailure(call: Call, t: Throwable) {
Log.d("TAG: onFailure", "onFailure: "+t.message)
}
})`
Я пытаюсь получить данные профиля исполнителя, описание изображения dazzer apienter здесь

Подробнее здесь: https://stackoverflow.com/questions/791 ... r-api-call
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»