I have tested the intent of notification about 4 or 5 days. I diappointed myself and I can't reach my goal. I think it's not too difficult but I can't get it. I want to go current running activity when I click the notification. I used many things in intent.
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
notificationIntent.setAction(Intent.ACTION_MAIN);
notificationIntent.addCategory(Intent.CATEGORY_LAUNCHER);
In pendingIntent,
PendingIntent intent = PendingIntent.getActivity(context, 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
In manifest,
android:launchMode="singleTop" // android:launchMode="singleTask" // android:launchMode="singleInstance"
but it always go the class I give at intent.Somebody help me, I have no idea.