0

I want to open my android app as soon as notification is arrived without user interaction . But as my BroadcastReceiver cannot extend Activity so how I will I open another activity (as it requires Intent).

public class GcmBroadcastReceiver extends WakefulBroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
    ComponentName comp = new ComponentName(context.getPackageName(),
            GCMNotificationIntentService.class.getName());

    startWakefulService(context, (intent.setComponent(comp)));
    setResultCode(Activity.RESULT_OK);
}
}
SwagDevelopers
  • 109
  • 2
  • 12

0 Answers0