I have two activities A and B where A is the parent of B. Now I show a notification that launches B. when I tap on the notification, B launches. Th
A
B
Try the approach described for Synthesize a new Back Stack for Deep Links
You will have use TaskStackBuild to build the back stack and get the PendingIntent when starting on Activity B.
Check this video from Android Design Patterns explains it simple.