本文整理汇总了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;
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
};
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}