本文整理汇总了Java中com.evernote.android.job.util.support.PersistableBundleCompat.putString方法的典型用法代码示例。如果您正苦于以下问题:Java PersistableBundleCompat.putString方法的具体用法?Java PersistableBundleCompat.putString怎么用?Java PersistableBundleCompat.putString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.evernote.android.job.util.support.PersistableBundleCompat
的用法示例。
在下文中一共展示了PersistableBundleCompat.putString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPeriodic
import com.evernote.android.job.util.support.PersistableBundleCompat; //导入方法依赖的package包/类
@Override
public void createPeriodic() {
for (int i = 0; i < 10; i++) {
JobRequest.Builder builder = new JobRequest.Builder("tag")
.setPeriodic(TimeUnit.MINUTES.toMillis(1))
.setRequiresCharging(random())
.setRequiresDeviceIdle(random())
.setRequiredNetworkType(random() ? JobRequest.NetworkType.ANY : JobRequest.NetworkType.CONNECTED)
.setRequirementsEnforced(random());
if (random()) {
PersistableBundleCompat extras = new PersistableBundleCompat();
extras.putString("key", "Hello world");
builder.setExtras(extras);
}
builder.build().schedule();
}
}
示例2: scheduleJobImmediately
import com.evernote.android.job.util.support.PersistableBundleCompat; //导入方法依赖的package包/类
public static void scheduleJobImmediately(boolean byUser, Calendar start, Calendar end) {
PersistableBundleCompat extras = new PersistableBundleCompat();
extras.putBoolean(ARG_INITIATED_BY_USER, byUser);
if (start != null && end != null) {
extras.putString(SyncJob.ARG_START_DATE, new SimpleDateFormat("yyyy-MM-dd", Locale.GERMANY).format(start.getTime()));
extras.putString(SyncJob.ARG_END_DATE, new SimpleDateFormat("yyyy-MM-dd", Locale.GERMANY).format(end.getTime()));
}
new JobRequest.Builder(TAG).startNow()
.setExtras(extras)
.build()
.schedule();
}
示例3: scheduleJob
import com.evernote.android.job.util.support.PersistableBundleCompat; //导入方法依赖的package包/类
public static void scheduleJob(Resource resource) {
PersistableBundleCompat extras = new PersistableBundleCompat();
extras.putString(ARG_RESOURCE_KEY, resource.getKey());
new JobRequest.Builder(TAG).setExtras(extras)
.startNow()
.build()
.schedule();
}