I am using a TabHost in my main layout, which only has 2 tabs right now. If I’m on the second tab and change orientation the app returns me to the first tab. Is there any way I can prevent this from happening?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Add following code into your manifest file where the tabHost activity is defined. Android automatically persists the state of selected tab.
It works for me.. And Also read dis Android documentation, which defines other techniques to persists activity states. link