本文整理汇总了Java中com.evernote.android.job.JobCreator类的典型用法代码示例。如果您正苦于以下问题:Java JobCreator类的具体用法?Java JobCreator怎么用?Java JobCreator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JobCreator类属于com.evernote.android.job包,在下文中一共展示了JobCreator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Recaller
import com.evernote.android.job.JobCreator; //导入依赖的package包/类
/**
*
* @param context
*/
private Recaller(Context context) {
callbackMapping = new HashMap<>();
jobManager = JobManager.create(context);
JobCreator jobCreator = new JobCreator() {
@Override
public Job create(final String tag) {
return new Job() {
@NonNull
@Override
protected Result onRunJob(Params params) {
endingJob(tag);
return Result.SUCCESS;
}
};
}
};
jobManager.addJobCreator(jobCreator);
}
示例2: jobCreator
import com.evernote.android.job.JobCreator; //导入依赖的package包/类
@Provides
@Singleton
JobCreator jobCreator(final WifiManager wifiManager,
final Settings settings,
final NotificationService notificationService,
final IssueDownloader issueDownloader,
final AutomaticDownloadScheduler automaticDownloadScheduler) {
return new JobCreator() {
@Override
public Job create(String tag) {
if (AutomaticIssueDownloadJob.TAG_PERIODIC.equals(tag) || AutomaticIssueDownloadJob.TAG_FALLBACK.equals(tag)) {
return new AutomaticIssueDownloadJob(
wifiManager, settings, notificationService,
issueDownloader, automaticDownloadScheduler);
}
return null;
}
};
}
示例3: onCreate
import com.evernote.android.job.JobCreator; //导入依赖的package包/类
@Override
public void onCreate() {
super.onCreate();
if (!BuildConfig.DEBUG) {
Fabric.with(this, new Crashlytics());
}
LeakCanary.install(this);
Inquiry.init(this, DB, 1);
Glide.get(this)
.register(AppInfo.class, InputStream.class, new AppIconLoader.Factory());
Glide.get(this)
.register(Uri.class, InputStream.class, new FaviconLoader.Factory());
JobManager.create(this)
.addJobCreator(new JobCreator() {
@Override
public Job create(String tag) {
switch (tag) {
case CleanupJob.TAG:
return new CleanupJob();
default:
throw new RuntimeException("Cannot find job for tag " + tag);
}
}
});
JobManager.instance().cancelAll();
new JobRequest.Builder(CleanupJob.TAG)
//1 day
.setPeriodic(86400000)
.build()
.schedule();
}
示例4: SpyableJobCreator
import com.evernote.android.job.JobCreator; //导入依赖的package包/类
public SpyableJobCreator(JobCreator jobCreator) {
mJobCreator = jobCreator;
}
示例5: jobCreator
import com.evernote.android.job.JobCreator; //导入依赖的package包/类
JobCreator jobCreator();