本文整理汇总了Java中android.support.v4.app.JobIntentService类的典型用法代码示例。如果您正苦于以下问题:Java JobIntentService类的具体用法?Java JobIntentService怎么用?Java JobIntentService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JobIntentService类属于android.support.v4.app包,在下文中一共展示了JobIntentService类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdate
import android.support.v4.app.JobIntentService; //导入依赖的package包/类
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
// There may be multiple widgets active, so update all of them
for (int appWidgetId : appWidgetIds) {
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.app_widget_empty);
Intent intent = new Intent(context, MainActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
views.setOnClickPendingIntent(R.id.appwidget_root, pendingIntent);
appWidgetManager.updateAppWidget(appWidgetId, views);
}
// tell service to update all widgets
JobIntentService.enqueueWork(context, AppWidgetUpdateService.class, 1, new Intent());
}
示例2: onReceive
import android.support.v4.app.JobIntentService; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
JobIntentService.enqueueWork(context, ComplicationUpdateService.class, 1, intent);
}
示例3: onReceive
import android.support.v4.app.JobIntentService; //导入依赖的package包/类
@Override
public void onReceive(Context context, Intent intent) {
JobIntentService.enqueueWork(context, AppWidgetUpdateService.class, 1, intent);
}