当前位置: 首页>>代码示例>>Java>>正文


Java JobCreator类代码示例

本文整理汇总了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);
}
 
开发者ID:GRnice,项目名称:PandwarfDefenderProject,代码行数:24,代码来源:Recaller.java

示例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;
        }
    };

}
 
开发者ID:notizklotz,项目名称:derbund-downloader,代码行数:21,代码来源:DownloadModule.java

示例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();
}
 
开发者ID:plusCubed,项目名称:anticipate,代码行数:39,代码来源:App.java

示例4: SpyableJobCreator

import com.evernote.android.job.JobCreator; //导入依赖的package包/类
public SpyableJobCreator(JobCreator jobCreator) {
    mJobCreator = jobCreator;
}
 
开发者ID:evernote,项目名称:android-job,代码行数:4,代码来源:DummyJobs.java

示例5: jobCreator

import com.evernote.android.job.JobCreator; //导入依赖的package包/类
JobCreator jobCreator(); 
开发者ID:notizklotz,项目名称:derbund-downloader,代码行数:2,代码来源:DownloadComponent.java


注:本文中的com.evernote.android.job.JobCreator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。