문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top