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

  • Home
  • SEARCH
  • 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 9243119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:44:19+00:00 2026-06-18T08:44:19+00:00

I am stuck with my issue.Thing is that its a custom Tab Widget.In that

  • 0

I am stuck with my issue.Thing is that its a custom Tab Widget.In that have multiple
tab like Home – News – Abc – PQR .

The Activity should be for both orientation like portrait and landscape. so for that each tab have two xml for portrait which is store at layout-port/file.xml and landscape which store at layout-land/file.xml

For manage orientation portrait to landscape i have added android:configChanges="orientation|keyboardHidden" rule tag in each activity.

  • TAB_SAMPLE.java Tab file.
  • TAB_GROUP_ACTIVITY each Tab Group activity File
  • file.java Task file

After all this stuff i get issue here :

If i addandroid:configChanges=”orientation|keyboardHidden”rule tag in tab_sample activity then its working perfect. like manage different view. port to land and land to port but its not working in Home.java.

Now if i remove android:configChanges="orientation|keyboardHidden" rule tag in tab_sample activity then its working for Home activity not for News.java

Mean when i change the orientation its keeping same xml form port not use from layout-land.in the sense its call OnCreate() again.

So as i found may be issue is in Tab Widget.

Update

Now after tracing my code i get that main issue is in grid view activity because its only activity which is not working.

Issue is between Tab host v/s Grid View. I don’t know why its not taking layout-land xml file. i found this as same issue but no replay on that question also

see in Detail manifestfile.xml
I want to maintain both portrait and landscape in all activity.

Both XML File

Please help me how to solve this.

  • 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-18T08:44:21+00:00Added an answer on June 18, 2026 at 8:44 am

    Oooohhh Finally i got the solution for above issue. It’s was very difficult.

    For maintain the state of orientation Landscape to portrait and vice-versa we generally adding android:configChanges="keyboardHidden|orientation" property tag under activity.

    But here may be issue is Tab_Group_ Activity due to that i am not able to maintain state in GridView. Grid_File.java is Only single java file which was not handling the orientation rest of all other working perfectly.

    Now if i remove android:configChanges="keyboardHidden|orientation" from TAB_SAMPLE.java then Its handling only Grid_File.java not others.

    mean that was keeping same Layout XML in landscape also where i have two separate XML File.
    

    Here is my solution:

    I have add android:configChanges="keyboardHidden|orientation" in TAB_SAMPLE.java as well as
    implement onConfigurationChanged(Configuration newConfig) and set Number of column of grid. like gridView.setNumColumns(6);

    @Override
        public void onConfigurationChanged(Configuration newConfig)
        {
            super.onConfigurationChanged(newConfig);
            // gridView.setSelection(index);
            if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE)
            {
    
                // Log.e("On Config Change", "LANDSCAPE");
                gridView.setNumColumns(6);
    
            } else
            {
    
                // Log.e("On Config Change", "PORTRAIT");
                gridView.setNumColumns(4);
            }
        }
    

    Generally we are adding either android:configChanges="keyboardHidden|orientation" tag under activity or implementing onConfigurationChanged(Configuration newConfig) but here i have written both.

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

Sidebar

Related Questions

I am stuck with a peculiar issue here. I have a script that basically
so i have been stuck with this issue for 3 weeks now and i
I'm using git hooks for the first time and stuck on an issue that
I have an issue that has just recently come to my attention. We have
Im new to the pentaho suite and its automation functionality. i have files that
Morning Guys, I have a CSS issue that's driving me up the wall. I
I have a custom role provider that inherits off RoleProvider. In the web app
I have an issue much like this user , but I want to take
I am stuck on a issue. I am trying to set user-environment variables using
I am stuck with this issue for a long time. I searched for this

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.