Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7957131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:12:11+00:00 2026-06-04T04:12:11+00:00

In my Activity I have two Gallery items one ExpandableListView and for the children

  • 0

In my Activity I have two Gallery items one ExpandableListView and for the children of the ExpandableListView I am having a GridView. Program runs perfectly. What I need is to handle orientation change. I know, when orientation change, activity will call onDestroy and after that onCreate. Because of that my ExpandableListView will collapsed even though the user has expanded before he has done an orientation change.

I found a great concept for handling rotation changes in StackOverflow. This is the link. I have tried to implement that way but I have failed.

What I need is to take the same interface that user has used before the orientation change even after the orientation change happen. Please guide me.

Update with the Manifest content

<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >

    <activity 
        android:name=".activities.HomeActivity"  
        android:configChanges="keyboardHidden|orientation|screenLayout" >       

        <intent-filter>
            <action android:name="android.intent.action.MAIN" ></action>
            <category android:name="android.intent.category.LAUNCHER" ></category>
        </intent-filter>            
    </activity>

    <activity 
        android:name=".activities.WebViewActivity"
        android:configChanges="keyboardHidden|orientation|screenLayout" >          
    </activity>

</application>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:12:12+00:00Added an answer on June 4, 2026 at 4:12 am

    Handling rotation could be trivial and depends on what you have to react to when the screen rotates. If you have nothing in particular to do, you can always tell Android itself to manage the rotation, and avoid restarting your activity. This could be achieved by declaring in the AndroidManifest.xml android:configChanges="orientation". If you do so, Android will call onConfigurationChanged, that you can always override. If you want your activity to restart when the screen rotates, you have to save the current state. That is, in your case, it could be the current groups and children currently collapsed and re collapse. You can use onSavedInstanceState()/onRestoreInstanceState() to save and restore the states you need.

    Edit: if you are targeting API level 13, you have to add the screenSize option to the android:configChanges in conjunction with the orientation option as stated in the documentation:

    The screen orientation has changed — the user has rotated the device.

    Note: If your application targets API level 13 or higher (as declared
    by the minSdkVersion and targetSdkVersion attributes), then you should
    also declare the “screenSize” configuration, because it also changes
    when a device switches between portrait and landscape orientations.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Activity, I have two Gallery items. I am implementing OnItemClickListener so I
I have two relatively simple codes. One main activity and one intent service. Main
This is my situation. I have two activities: ONE and TWO. In TWO activity
i have two Activity in this i take pixels of image from one activity
I have two tables Activity and Action. One or more actions can be performed
I have two layouts for one activity like layout-port and layout-land, with different designs.
I have two spinners (day_spin and time_spin) in one Activity . I want to
Basically, I got one activity has two layouts, one is gridview, which has mBaseAdapter
I have a Tab Host with two Tabs: One for an image gallery and
I have two activities, one is main and I have another activity called Test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.