You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm a very noob user, and I'm trying to retrieve a vary specific Playlist from a very specific userId. It seems that I'm not able to do it, the only examples I found are old and don't help me. Here's what I tried:
SpotifyApi api = new SpotifyApi();
api.setAccessToken(token);
SpotifyService spotify = api.getService();
spotify.getPlaylists("USERID", new Callback<Pager<Playlist>>() {
@Override
public void success(Pager<Playlist> playlistPager, Response response) {
Log.d("TEST", "Got the playlists");
List<Playlist> playlists = playlistPager.items;
for (Playlist p : playlists) {
Log.e("TEST", p.name + " - " + p.id);
}
}
@Override
public void failure(RetrofitError error) {
Log.e("TEST", "Could not get playlists");
}
});
If I copy-paste this, it underlines Callback<Pager> and gives me the error: Class 'Anonymous Class derived from Callback' must either be declared abstract or implement abstract method 'onResponse(Call, Response) in 'Callback'
if I press alt+enter and add this method and onFailure and I adapt the succes() and failure() methods to those, it will be:
spotify.getPlaylists("USERID", new Callback<Pager<Playlist>>() {
@Override
public void onResponse(Call<Pager<Playlist>> playlistPager, Response<Pager<Playlist>> response) {
Log.d("TEST", "Got the playlists");
List<Playlist> playlists = playlistPager.items;
for (Playlist p : playlists) {
Log.e("TEST", p.name + " - " + p.id);
}
}
@Override
public void onFailure(Call<Pager<Playlist>> call, Throwable t) {
Log.e("TEST", "Could not get playlists");
}
});
But now, items is red coloured and it gives me this error: Cannot resolve symbol 'items'
and I can't find any solution to this :(
Thank you, and sorry if it's a silly question
The text was updated successfully, but these errors were encountered:
BRKNCD
changed the title
Can't getPlaylist
Can't getPlaylist labels:help wanted
Oct 14, 2018
BRKNCD
changed the title
Can't getPlaylist labels:help wanted
Can't getPlaylist labels:helpwanted
Oct 14, 2018
BRKNCD
changed the title
Can't getPlaylist labels:helpwanted
Can't getPlaylist
Oct 14, 2018
Hello, I'm a very noob user, and I'm trying to retrieve a vary specific Playlist from a very specific userId. It seems that I'm not able to do it, the only examples I found are old and don't help me. Here's what I tried:
https://stackoverflow.com/questions/35110025/accessing-list-of-playlists-from-pager-object
If I copy-paste this, it underlines Callback<Pager> and gives me the error:
Class 'Anonymous Class derived from Callback' must either be declared abstract or implement abstract method 'onResponse(Call, Response) in 'Callback'
if I press alt+enter and add this method and onFailure and I adapt the succes() and failure() methods to those, it will be:
But now, items is red coloured and it gives me this error: Cannot resolve symbol 'items'
and I can't find any solution to this :(
Thank you, and sorry if it's a silly question
The text was updated successfully, but these errors were encountered: