本文整理汇总了Java中com.google.api.services.youtube.model.PlaylistListResponse类的典型用法代码示例。如果您正苦于以下问题:Java PlaylistListResponse类的具体用法?Java PlaylistListResponse怎么用?Java PlaylistListResponse使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlaylistListResponse类属于com.google.api.services.youtube.model包,在下文中一共展示了PlaylistListResponse类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: doInBackground
import com.google.api.services.youtube.model.PlaylistListResponse; //导入依赖的package包/类
@Override
protected PlaylistListResponse doInBackground(String[]... params) {
final String[] playlistIds = params[0];
PlaylistListResponse playlistListResponse;
try {
playlistListResponse = mYouTubeDataApi.playlists()
.list(YOUTUBE_PLAYLIST_PART)
.setId(TextUtils.join(",", playlistIds))
.setFields(YOUTUBE_PLAYLIST_FIELDS)
.setKey(ApiKey.YOUTUBE_API_KEY)
.execute();
} catch (IOException e) {
e.printStackTrace();
return null;
}
return playlistListResponse;
}
开发者ID:mrprona92,项目名称:SecretBrand,代码行数:21,代码来源:GetPlaylistTitlesAsyncTask.java
示例2: nextToken
import com.google.api.services.youtube.model.PlaylistListResponse; //导入依赖的package包/类
private String nextToken() {
String result = null;
if (response == null)
result = ""; // first time
else {
// is there a better way of doing this?
if (response instanceof SearchListResponse) {
result = ((SearchListResponse) response).getNextPageToken();
} else if (response instanceof PlaylistItemListResponse) {
result = ((PlaylistItemListResponse) response).getNextPageToken();
} else if (response instanceof SubscriptionListResponse) {
result = ((SubscriptionListResponse) response).getNextPageToken();
} else if (response instanceof VideoListResponse) {
result = ((VideoListResponse) response).getNextPageToken();
} else if (response instanceof PlaylistListResponse) {
result = ((PlaylistListResponse) response).getNextPageToken();
} else {
doHandleExceptionMessage("nextToken bug!");
}
}
return result;
}
开发者ID:sgehrman,项目名称:UTubeTV,代码行数:25,代码来源:YouTubeAPI.java
示例3: getNext
import com.google.api.services.youtube.model.PlaylistListResponse; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public List<Playlist> getNext() throws IOException {
final List <Playlist> playlists = new ArrayList<>();
_playlistReq.setPageToken(_nextToken);
PlaylistListResponse playlistListResponse = _playlistReq.execute();
playlists.addAll(playlistListResponse.getItems());
_nextToken = playlistListResponse.getNextPageToken();
return playlists;
}
开发者ID:LehmRob,项目名称:FeedMeYoutube,代码行数:13,代码来源:PlaylistCrawler.java
示例4: onCreate
import com.google.api.services.youtube.model.PlaylistListResponse; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
if (getArguments() != null) {
mPlaylistIds = getArguments().getStringArray(ARG_YOUTUBE_PLAYLIST_IDS);
}
// start fetching the playlist titles
new GetPlaylistTitlesAsyncTask(mYouTubeDataApi) {
@Override
protected void onPreExecute() {
super.onPreExecute();
mProgressDialog.show();
}
@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());
}
// update the spinner adapter with the titles of the playlists
ArrayAdapter<List<String>> spinnerAdapter = new ArrayAdapter(getContext(), android.R.layout.simple_spinner_item, mPlaylistTitles);
spinnerAdapter.setDropDownViewResource(SPINNER_ITEM_DROPDOWN_LAYOUT_ID);
mPlaylistSpinner.setAdapter(spinnerAdapter);
mProgressDialog.hide();
}
}.execute(mPlaylistIds);
}
开发者ID:akoscz,项目名称:YouTubePlaylist,代码行数:35,代码来源:YouTubeRecyclerViewFragment.java
示例5: onCreate
import com.google.api.services.youtube.model.PlaylistListResponse; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
mYouTubeDataApi = new YouTube.Builder(mTransport, mJsonFactory, null)
.setApplicationName(getResources().getString(R.string.app_name))
.build();
mInterstitialAd = new InterstitialAd(mActivity);
mInterstitialAd.setAdUnitId(getString(R.string.interstitial_ad_unit_id));
mInterstitialAd.loadAd(new AdRequest.Builder().addTestDevice("121EC3F83A2EAFBD46DB00F1773A13A0").build());
mInterstitialAd.setAdListener(new AdListener() {
@Override
public void onAdClosed() {
// Load the next interstitial.
mInterstitialAd.loadAd(new AdRequest.Builder().addTestDevice("121EC3F83A2EAFBD46DB00F1773A13A0").build());
}
});
if (getArguments() != null) {
mPlaylistIds = getArguments().getStringArray(ARG_PLAYLIST_IDS);
}
// start fetching the playlist titles
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());
}
// update the spinner adapter with the titles of the playlists
if(mActivity==null){
return;
}
ArrayAdapter<List<String>> spinnerAdapter = new ArrayAdapter(mActivity, android.R.layout.simple_spinner_item, mPlaylistTitles);
spinnerAdapter.setDropDownViewResource(SPINNER_ITEM_DROPDOWN_LAYOUT_ID);
mPlaylistSpinner.setAdapter(spinnerAdapter);
}
}.execute(mPlaylistIds);
}
开发者ID:mrprona92,项目名称:SecretBrand,代码行数:49,代码来源:YouTubeRecyclerPlaylistFragment.java
注:本文中的com.google.api.services.youtube.model.PlaylistListResponse类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论