0

I have multiple activities in my application. I want when notification shows in the bar, and clicking on it, it will resume from the activity which is currently in background.

Currently, I am using this, but it will always take me to the Home Activity which is Launcher activity.

Intent intent =new Intent(ServiceClass.this, home.class);
PendingIntent pendingIntent = PendingIntent.getActivity(GcmIntentService.this, 0, intent, 0);
userLearner
  • 127
  • 1
  • 11

1 Answers1

0

use the same intent filters as android uses when launches the app:

    final Intent notificationIntent = new Intent(context, YourActivity.class);
    notificationIntent.setAction(Intent.ACTION_MAIN);
    notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
Pratik Butani
  • 60,504
  • 58
  • 273
  • 437
Ajay Venugopal
  • 1,544
  • 1
  • 17
  • 30