本文整理汇总了Java中android.os.PersistableBundle.getString方法的典型用法代码示例。如果您正苦于以下问题:Java PersistableBundle.getString方法的具体用法?Java PersistableBundle.getString怎么用?Java PersistableBundle.getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.os.PersistableBundle
的用法示例。
在下文中一共展示了PersistableBundle.getString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doInBackground
import android.os.PersistableBundle; //导入方法依赖的package包/类
@Override
protected Void doInBackground(Void... params) {
PersistableBundle bundle = mJobParameters.getExtras();
if (bundle == null) {
Log.e(TAG, "No data passed to task for job " + mJobParameters.getJobId());
return null;
}
String id = bundle.getString(ID_KEY);
String contentId = bundle.getString(CONTENT_ID_KEY);
long duration = bundle.getLong(DURATION_KEY);
long progress = bundle.getLong(PROGRESS_KEY);
String title = bundle.getString(TITLE_KEY);
String description = bundle.getString(DESCRIPTION_KEY);
String cardImageURL = bundle.getString(CARD_IMAGE_URL_KEY);
ClipData clipData = new ClipData.Builder().setClipId(id)
.setContentId(contentId)
.setDuration(duration)
.setProgress(progress)
.setTitle(title)
.setDescription(description)
.setCardImageUrl(cardImageURL)
.build();
SampleTvProvider.addWatchNextContinue(getApplicationContext(), clipData);
return null;
}
示例2: doInBackground
import android.os.PersistableBundle; //导入方法依赖的package包/类
@Override
protected Void doInBackground(Void... params) {
PersistableBundle bundle = mJobParameters.getExtras();
if (bundle == null) {
Log.e(TAG, "No data passed to task for job " + mJobParameters.getJobId());
return null;
}
String clipId = bundle.getString(ID_KEY);
SampleTvProvider.deleteWatchNextContinue(getApplicationContext(), clipId);
return null;
}
示例3: doInBackground
import android.os.PersistableBundle; //导入方法依赖的package包/类
@Override
protected Void doInBackground(Void... voids) {
if (isCancelled()) {
return null;
}
PersistableBundle extras = params.getExtras();
String inputId = extras.getString(SyncJobService.BUNDLE_KEY_INPUT_ID);
if (inputId == null) {
return null;
}
XmlTvParser.TvListing listings = RichFeedUtil.getRichTvListings(mContext);
LongSparseArray<XmlTvParser.XmlTvChannel> channelMap = TvContractUtils.buildChannelMap(
mContext.getContentResolver(), inputId, listings.channels);
if (channelMap == null) {
return null;
}
boolean currentProgramOnly = extras.getBoolean(
SyncJobService.BUNDLE_KEY_CURRENT_PROGRAM_ONLY, false);
long startMs = System.currentTimeMillis();
long endMs = startMs + FULL_SYNC_WINDOW_SEC * 1000;
if (currentProgramOnly) {
// This is requested from the setup activity, in this case, users don't need to wait
// for the full sync. Sync the current programs first and do the full sync later in
// the background.
endMs = startMs + SHORT_SYNC_WINDOW_SEC * 1000;
}
for (int i = 0; i < channelMap.size(); ++i) {
Uri channelUri = TvContract.buildChannelUri(channelMap.keyAt(i));
if (isCancelled()) {
return null;
}
List<Program> programs = getPrograms(channelUri, channelMap.valueAt(i),
listings.programs, startMs, endMs);
// Double check if the job is cancelled, so that this task can be finished faster
// after cancel() is called.
if (isCancelled()) {
return null;
}
updatePrograms(channelUri, programs);
}
return null;
}