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


Java Job类代码示例

本文整理汇总了Java中com.evernote.android.job.Job的典型用法代码示例。如果您正苦于以下问题:Java Job类的具体用法?Java Job怎么用?Java Job使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Job类属于com.evernote.android.job包,在下文中一共展示了Job类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Nullable
@Override
public Job create(@NonNull String tag) {
    if (tag.equals(NOTIFICATIONS_JOB_TAG)) {
        SharedPreferences preferences = context.getSharedPreferences(
                context.getString(R.string.preferences_file_key), Context.MODE_PRIVATE);
        final String domain = preferences.getString("domain", null);

        if(domain == null) {
            return null;
        } else {
            return new NotificationPullJob(domain, context);
        }
    }
    return null;
}
 
开发者ID:Vavassor,项目名称:Tusky,代码行数:17,代码来源:NotificationPullJobCreator.java

示例2: Recaller

import com.evernote.android.job.Job; //导入依赖的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

示例3: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(@NonNull String tag) {
    switch (tag) {
        case PushRestApiJob.TAG:
            return new PushRestApiJob();
        case SyncJob.TAG:
            return new SyncJob();
        case AutoDownloadJob.TAG:
            return new AutoDownloadJob();
        case DownloadFinishedPaperJob.TAG:
            return new DownloadFinishedPaperJob();
        case DownloadFinishedResourceJob.TAG:
            return new DownloadFinishedResourceJob();
        default:
            return null;
    }
}
 
开发者ID:die-tageszeitung,项目名称:tazapp-android,代码行数:18,代码来源:TazJobCreator.java

示例4: onRunTask

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public int onRunTask(TaskParams taskParams) {
    int jobId = Integer.parseInt(taskParams.getTag());
    JobProxy.Common common = new JobProxy.Common(this, CAT, jobId);

    JobRequest request = common.getPendingRequest(true, true);
    if (request == null) {
        return GcmNetworkManager.RESULT_FAILURE;
    }

    Job.Result result = common.executeJobRequest(request, taskParams.getExtras());
    if (Job.Result.SUCCESS.equals(result)) {
        return GcmNetworkManager.RESULT_SUCCESS;
    } else {
        return GcmNetworkManager.RESULT_FAILURE;
    }
}
 
开发者ID:evernote,项目名称:android-job,代码行数:18,代码来源:PlatformGcmService.java

示例5: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(@NonNull String tag) {
    switch (tag) {
        case SuccessJob.TAG:
            return new SuccessJob();
        case RescheduleJob.TAG:
            return new RescheduleJob();
        case FailureJob.TAG:
            return new FailureJob();
        case TwoSecondPauseJob.TAG:
            return new TwoSecondPauseJob();
        case SuccessDailyJob.TAG:
            return new SuccessDailyJob();
        default:
            return null;
    }
}
 
开发者ID:evernote,项目名称:android-job,代码行数:18,代码来源:DummyJobs.java

示例6: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(@NonNull String tag) {
    switch (tag) {
        case SearchCalendarEventsJob.JOB_TAG:
            return new SearchCalendarEventsJob();
        case SearchCalendarEventsJob.JOB_TAG_SHORT:
            return new SearchCalendarEventsJob();
        case WifiScanJob.JOB_TAG:
            return new WifiScanJob();
        case WifiScanJob.JOB_TAG_SHORT:
            return new WifiScanJob();
        case BluetoothScanJob.JOB_TAG:
            return new BluetoothScanJob();
        case BluetoothScanJob.JOB_TAG_SHORT:
            return new BluetoothScanJob();
        case GeofenceScannerJob.JOB_TAG:
            return new GeofenceScannerJob();
        case GeofenceScannerJob.JOB_TAG_START:
            return new GeofenceScannerJob();
        case AboutApplicationJob.JOB_TAG:
            return new AboutApplicationJob();

        default:
            return null;
    }
}
 
开发者ID:henrichg,项目名称:PhoneProfilesPlus,代码行数:27,代码来源:PPJobsCreator.java

示例7: jobCreator

import com.evernote.android.job.Job; //导入依赖的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

示例8: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(String tag) {
    switch (tag) {
        case RNJob.JOB_TAG:
            return new RNJob();
        default:
            return null;
    }
}
 
开发者ID:jamesisaac,项目名称:react-native-background-task,代码行数:10,代码来源:RNJobCreator.java

示例9: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(String tag) {
    if (ReminderJob.TAG.equals(tag)) {
        return new ReminderJob();

    } else if (SnoozeJob.TAG.equals(tag)) {
        return new SnoozeJob();

    } else {
        return null;
    }
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:13,代码来源:AppJobCreator.java

示例10: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(String tag) {
    switch (tag) {
        case UpdateTopologyJob.TAG:
            return new UpdateTopologyJob();
        case SyncTripsJob.TAG:
            return new SyncTripsJob();
        default:
            return null;
    }
}
 
开发者ID:gbl08ma,项目名称:underlx,代码行数:12,代码来源:MainService.java

示例11: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(@NonNull String tag) {
    switch (tag) {
        case NotificationsJob.TAG:
            return new NotificationsJob();
        default:
            return null;
    }
}
 
开发者ID:RadiationX,项目名称:ForPDA,代码行数:10,代码来源:NotificationsJobCreator.java

示例12: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Nullable
@Override
public Job create(@NonNull String tag) {
    try {
        if (tag.startsWith(WebTimes.SyncJob.TAG)) {
            Times t = Times.getTimes(Long.parseLong(tag.substring(WebTimes.SyncJob.TAG.length())));
            if (t instanceof WebTimes)
                return ((WebTimes) t).new SyncJob();
        }
    } catch (Exception e) {
        Crashlytics.logException(e);
    }
    return null;
}
 
开发者ID:metinkale38,项目名称:prayer-times-android,代码行数:15,代码来源:App.java

示例13: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override public Job create(String tag) {
	switch (tag) {
		case ChangesetAutoCloserJob.TAG:
			return changesetAutoCloserJobProvider.get();
		default:
			return null;
	}
}
 
开发者ID:westnordost,项目名称:StreetComplete,代码行数:9,代码来源:StreetCompleteJobCreator.java

示例14: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(String tag) {
    switch (tag) {
        case HookFetchJob.TAG:
            return new HookFetchJob();
        default:
            return null;
    }
}
 
开发者ID:Ashish-Bansal,项目名称:OneTapVideoDownload,代码行数:10,代码来源:HookFetchJobCreator.java

示例15: create

import com.evernote.android.job.Job; //导入依赖的package包/类
@Override
public Job create(String tag) {
    Timber.v("start job");
    if (SyncJob.TAG.equals(tag)) {
        return new SyncJob(mContext);
    }
    return null;
}
 
开发者ID:TomeOkin,项目名称:LsPush,代码行数:9,代码来源:LsPushJobCreator.java


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