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 9173521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:36:02+00:00 2026-06-17T16:36:02+00:00

I created a action bar in xml for use in all activities. I used

  • 0

I created a action bar in xml for use in all activities. I used the include tag for it.
One of my activities have just a GridView tag. you can see it’s source below:

<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/gv_level"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:background="@drawable/background_gradient"
    android:columnWidth="100dp"
    android:gravity="center"
    android:numColumns="auto_fit"
    android:stretchMode="columnWidth" >
</GridView>  

It doesn’t have any problem but when I add the include tag or any other tag to this (similar below source)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<include
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_weight="0"
    layout="@layout/action_bar" />

<GridView
    android:id="@+id/gv_level"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:background="@drawable/background_gradient"
    android:columnWidth="100dp"
    android:gravity="center"
    android:numColumns="auto_fit"
    android:stretchMode="columnWidth" >
</GridView>

It doesn’t give me an error but the GridView is hidden when the activity appears.
Is there a solution for this problem?

  • 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-17T16:36:03+00:00Added an answer on June 17, 2026 at 4:36 pm

    but the gridview is hidden when activity apear. it there ant solution
    for it? thanks.

    You may want to either set the orientation of the LinearLayout to vertical so your included layout doesn’t push the GridView outside of the screen on the right or you could use wrap_content for the included layout’s width. Using the orientation change:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent" 
        android:orientation="vertical" >
    
    <include
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0"
        layout="@layout/action_bar" />
    // ... rest of the layout
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following xml: <Root> <SomethingA/> <SomethingB/> <SomethingC/> <SomeOtherThing action=Foo> <Bar/> <Bar/> </SomeOtherThing>
I have created a new android project. I want to have a action bar
I've created an open graph action, and so far I can only seem to
I have successfully created a custom Facebook open graph action, and have been able
I want my activity looks like action bar, with custom view tabs created with
I have been trying to change the background of my action bar for quite
I want to have an Action Bar like foursquare. What I want is tabs
Having some trouble overriding ActionBarSherlock styles, hopefully someone can help. I have created a
I am looking to create a menu bar with a specic type of action
I'm trying to make it so when a model is created via created action

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.