public class GoogleCloudMessagingBroadcastReceiver extends WakefulBroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { // create a component associated to the service that will handle the intent ComponentName component = new ComponentName( context.getPackageName(), GoogleCloudMessagingIntentService.class.getName() ); // start the service // maintain the mobile device awake startWakefulService(context, (intent.setComponent(component))); setResultCode(Activity.RESULT_OK); } }