0

I have an app with 3 activities:

MainActivity
ActivityOne
ActivityTwo

I set the parent of ActivityOne is MainActivity and of ActivityTwo is ActivityOne in the manifest xml file

I created a button in the main activity that trigger a notification, when I click the notification, it directs me to ActivityTwo..

what I want to do is, when I click back button in the navigation bar it directs me to ActivityOne, and when I click it again, it directs me to MainActivity

I wan't to be able to do this, while the app is not running at the begginning, i.e using taskStackBuilder

I have been trying like for ever, but still in vain.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Omar Labib
  • 55
  • 9
  • You can start ActivityOne from notification and start ActivityTwo from ActivityOne. Both activities must be started. Or you can handle back button press from ActivityTwo to start ActivityOne. – Ali Oct 28 '17 at 22:29
  • is there away to set on click listener for the back button? this is what you meant, right? – Omar Labib Oct 29 '17 at 22:02
  • https://stackoverflow.com/questions/5312334/how-to-handle-back-button-in-activity – Ali Oct 29 '17 at 22:31

0 Answers0