Example usage for android.content Intent setComponent

List of usage examples for android.content Intent setComponent

Introduction

In this page you can find the example usage for android.content Intent setComponent.

Prototype

public @NonNull Intent setComponent(@Nullable ComponentName component) 

Source Link

Document

(Usually optional) Explicitly set the component to handle the intent.

Usage

From source file:com.beintoo.beclubapp.GcmBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    // Explicitly specify that GcmIntentService will handle the intent.
    ComponentName comp = new ComponentName(context.getPackageName(),
            com.beintoo.beclubapp.GcmIntentService.class.getName());
    // Start the service, keeping the device awake while it is launching.
    startWakefulService(context, (intent.setComponent(comp)));
    setResultCode(Activity.RESULT_OK);/*  w w w  . j av  a 2 s  .  c o m*/
}

From source file:com.example.jaecheol.gcm.GcmBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    // Explicitly specify that GcmIntentService will handle the intent.
    ComponentName comp = new ComponentName(context.getPackageName(),
            com.example.jaecheol.gcm.GcmIntentService.class.getName());

    // Start the service, keeping the device awake while it is launching.
    startWakefulService(context, (intent.setComponent(comp)));
    setResultCode(Activity.RESULT_OK);/*ww  w. ja  v  a  2  s .  c o  m*/

}

From source file:com.testpush.notification.GcmBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {

    Log.d("RECEIVE", "RECEIVE");

    // Explicitly specify that GcmIntentService will handle the 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);/*w w  w. j  a  v  a2  s. com*/
}

From source file:com.ayaseya.nolnotification.GcmBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    //       Log.v(TAG, "onReceive()");

    // Explicitly specify that GcmIntentService will handle the 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);/*from   w  ww .  j  a  v  a  2s.  c  o m*/
}

From source file:com.sopinet.trazeo.app.chat.GcmBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    Log.d("GCM", "OnReceive GCM Global");
    // Explicitly specify that GcmIntentService will handle the 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);//from   www .j  a v a 2s  . c o  m
}

From source file:ca.utoronto.ece1778.baton.gcm.client.main.GcmBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    // Explicitly specify that GcmIntentService will handle the intent.
    ComponentName comp = new ComponentName(context.getPackageName(), GcmIntentService.class.getName());
    Log.i(TAG, context.getPackageName());
    // Start the service, keeping the device awake while it is launching.
    startWakefulService(context, (intent.setComponent(comp)));
    setResultCode(Activity.RESULT_OK);/*  w  ww  . j  a  v a  2  s  . co m*/
}

From source file:com.nokia.example.capturetheflag.notifications.nokia.NokiaNotificationsBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    // Explicitly specify that NokiaNotificationsmIntentService will handle the intent.
    ComponentName comp = new ComponentName(context.getPackageName(),
            NokiaNotificationsIntentService.class.getName());

    // Start the service, keeping the device awake while it is launching.
    startWakefulService(context, (intent.setComponent(comp)));
    setResultCode(Activity.RESULT_OK);//from w ww. j  av a  2 s  .  c  om
}

From source file:com.xrci.standup.GcmBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    // Explicitly specify that GcmIntentService will handle the intent.
    ComponentName comp = new ComponentName(context.getPackageName(), GcmIntentService.class.getName());
    System.out.println("Came inside receiver");
    // Start the service, keeping the device awake while it is launching.
    startWakefulService(context, (intent.setComponent(comp)));
    setResultCode(Activity.RESULT_OK);//from   w w w .java  2  s  .co  m
}

From source file:org.symptomcheck.capstone.gcm.GcmBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    Log.i(TAG, "GcmRx;" + intent.toString());
    // Explicitly specify that GcmIntentService will handle the 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);/*from   w ww. j av  a 2  s  .  co  m*/
}

From source file:br.es.integracao.cliente.gcm.GCMBroadcastReceiver.java

@Override
public void onReceive(Context context, Intent intent) {
    // Especificar de forma explcita qual GcmIntentService que ir lidar
    // com a inteno
    ComponentName comp = new ComponentName(context.getPackageName(), GCMIntentService.class.getName());
    // Inicia o servio, mantendo o dispositivo acordado enquanto ele
    // estiver rodando.
    startWakefulService(context, (intent.setComponent(comp)));
    setResultCode(Activity.RESULT_OK);/*from w  w  w  .j a va  2s.co m*/
}