Code example for WakefulBroadcastReceiver

Methods: startWakefulService, setResultCode

0
	@Override 
	public void onReceive(Context context, Intent intent) {
		ComponentName comp = new ComponentName(context.getPackageName(),
                GcmIntentService.class.getName());
        // Start the service, keeping the device awake while it is launching. 
        startWakefulService(context, (intent.setComponent(comp)));
        setResultCode(Activity.RESULT_OK);
	} 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java