我正在使用YouTube数据API获取播放列表标题和缩略图。 我很容易用这个提到的代码获得标题,但没有得到缩略图。它给出了Null Object响应。
我已使用此Asyntask获取响应:
new GetPlaylistTitlesAsyncTask(mYouTubeDataApi) {
@Override
protected void onPostExecute(PlaylistListResponse playlistListResponse) {
// if we didn't receive a response for the playlist titles, then there's nothing to update
if (playlistListResponse == null)
return;
mPlaylistTitles = new ArrayList();
for (com.google.api.services.youtube.model.Playlist playlist : playlistListResponse.getItems()) {
mPlaylistTitles.add(playlist.getSnippet().getTitle());
Log.e("Titile", "" + "" + playlist.getSnippet().getTitle());
Log.e("Thumbnail", "" + "" + playlist.getSnippet().getThumbnails().getDefault().getUrl());
}
}
}.execute(mPlaylistIds);
正确获取播放列表标题但视频缩略图正在崩溃应用程序。需要立即帮助。