I have two activities A & B in my app.
I’ve learned how to save and restore all data whenever config change happens.
In my app, a user has to go to activity B from A (all the data is in B).
Now, whenever screen rotation happens, app restarts and goes to activity A.
How can I know about the last activity before screen rotation happened so that I can directly open the same activity and let my user continue ?
Try this it might help you.
Paste this code second activity. This method is called when screen orientation change.
For ex: portrait to landscape or vice versa.
Take one variable and manipulate that variable value to know on previous activity.