so when i click a button i want to go to previous layout, that ive been, for example im in layout 1. i go to layout 2 and when i click a button in layout 2 i go back to layout 1 BUT if im on layout 3 and i go to layout 2, i want to go back to layout 3, does that make sense?
1 -> 2 = go back to layout 1
3 -> 2 = go back to layout 3
this should be easy but cant seem to figure it out and im a beginner here