I have 15-20 activities in my application. I want when user clicks on the icon of my app on the homepage and the app is running in the background, user should always see the default screen. However, as per default android behavior users see the last screen that appeared before the application goes in background.
I also do not want to lose the back feature capability. Is there any way to know if user is navigating in the same application or user has switched to other application and coming back to my app.
I know we can use onpause() etc for this kind of thing but I have 15 activities and I want to do this change at one place and do not want to lose back button functionality?
I have 15-20 activities in my application. I want when user clicks on the
Share
Well in the onPause() of each activity you could either write to a shared preference file if it is the current activity running (and possibly save your backwards stack if you are using one to keep multiple backwards), then in each onResume you could switch intent to the main activity, which could then load up the shared data (either the one piece, or populate an ArrayDeque if you have a stack. ArrayDeque as opposed to Stack, because stack is deprecated, as it is based on the deprecated Vector.)
That might be a little messy, but might not be too bad (I would have to try it to really know).
good luck, I hope that helped. If not, I hope someone else can help.