Question

In my Android Application, I am using TabbedGroupActivity, where it is maintaing 5 tab Activities, when the app is in background for a while 30 mins or so. The tab selection automatically changing to default tab. but the Activity View is not changing. for ex: my default tab-1 and I selected tab-4, and I kept the app in background by pressing home button, if I open it again after some time, the selected tab is Tab-1, but the activity showing is tab-4 activity. Please suggest a solution.

Was it helpful?

Solution

Keep a local variable in main activity from where all tab activities are maintained and set the selected tab with the help of that local variable. When the activity goes in background and is opened again check that local variable and set the selected tab based on it instead of default tab. Hope that helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top