Java Code Examples for android.support.v4.app.JobIntentService

The following are top voted examples for showing how to use android.support.v4.app.JobIntentService. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: blockvote   File: AppWidget.java   View source code 5 votes vote down vote up
@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());
}
 
Example 2
Project: blockvote   File: AppWidget.java   View source code 5 votes vote down vote up
@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());
}
 
Example 3
Project: blockvote   File: ComplicationUpdateReceiver.java   View source code 4 votes vote down vote up
@Override
public void onReceive(Context context, Intent intent) {
	JobIntentService.enqueueWork(context, ComplicationUpdateService.class, 1, intent);
}
 
Example 4
Project: blockvote   File: AppWidgetUpdateReceiver.java   View source code 4 votes vote down vote up
@Override
public void onReceive(Context context, Intent intent) {
	JobIntentService.enqueueWork(context, AppWidgetUpdateService.class, 1, intent);
}
 
Example 5
Project: blockvote   File: ComplicationUpdateReceiver.java   View source code 4 votes vote down vote up
@Override
public void onReceive(Context context, Intent intent) {
	JobIntentService.enqueueWork(context, ComplicationUpdateService.class, 1, intent);
}
 
Example 6
Project: blockvote   File: AppWidgetUpdateReceiver.java   View source code 4 votes vote down vote up
@Override
public void onReceive(Context context, Intent intent) {
	JobIntentService.enqueueWork(context, AppWidgetUpdateService.class, 1, intent);
}