I am working on android application, lets assume i have the following activities in my application: act1, act2 and act3.
Each of the activities above has a fragments so act1 -> frag1, act2 -> frag2 and so on.
When my application is running and i opened frag1 and then i pressed the home button on my phone. i will be directed to the home page of my Phone.
And ethir if i pressed on the launched icon or pressed the back button again the application is resumed/opened act1 instead of frag1.
So my question here, how to make the application opened the recent fragment instead of the activity? frag1 instead of act1.
Thanks, If you want more information such as code example please tell me.