Java 类android.support.v4.app.JobIntentService 实例源码

项目:blockvote    文件:AppWidget.java   
@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());
}
项目:blockvote    文件:AppWidget.java   
@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());
}
项目:blockvote    文件:ComplicationUpdateReceiver.java   
@Override
public void onReceive(Context context, Intent intent) {
    JobIntentService.enqueueWork(context, ComplicationUpdateService.class, 1, intent);
}
项目:blockvote    文件:AppWidgetUpdateReceiver.java   
@Override
public void onReceive(Context context, Intent intent) {
    JobIntentService.enqueueWork(context, AppWidgetUpdateService.class, 1, intent);
}
项目:blockvote    文件:ComplicationUpdateReceiver.java   
@Override
public void onReceive(Context context, Intent intent) {
    JobIntentService.enqueueWork(context, ComplicationUpdateService.class, 1, intent);
}
项目:blockvote    文件:AppWidgetUpdateReceiver.java   
@Override
public void onReceive(Context context, Intent intent) {
    JobIntentService.enqueueWork(context, AppWidgetUpdateService.class, 1, intent);
}