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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:07:23+00:00 2026-06-15T18:07:23+00:00

I am developing an Android Application and I have an Activity that looks like

  • 0

I am developing an Android Application and I have an Activity that looks like this. I have a header and a footer that have fixed positions, and a ListView with clickable items in the middle. Below the ListView, I have a button.

It is working when I have a few items, but as I add more items, the button begins to disappear, like this.

When I have more items in that list that can be shown in the page, I have a scroll in the list. If I scroll down like this I can see all the items in the list, but the button is hidden.

I have had a lot of problems before trying to add a ListView inside a ScrollView, so I know it doesn’t work. As I am new in Android development, perhaps my XML layout files are a bit confusing, but I have a parent LinearLayout with two RelativeLayouts inside, one for the header and one for the middle and footer. The XML is something like this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="match_parent" 
    android:orientation="vertical"
    android:background="#FFFFFF">

    <RelativeLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" 
        android:orientation="horizontal"
        android:background="@drawable/background"
        android:gravity="center_vertical">

        <TextView
            android:id="@+id/title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
            android:layout_marginLeft="10dp"
            android:layout_marginTop="5dp"
            android:text="@string/baseTitle"
            android:textColor="#FFFFFF"
            android:layout_centerVertical="true"
            android:textSize="18dp"
            android:textStyle="bold"/>

        <Button 
            android:id="@+id/buttonHelp"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:background="@drawable/button_help"
            android:layout_centerVertical="true"
            android:layout_alignParentRight="true"/>

    </RelativeLayout>

    <RelativeLayout 
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="fill_vertical">

        <LinearLayout   
            android:id="@+id/buttonBar"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:gravity="center"
            android:background="#bdbdbd"
            android:layout_alignParentBottom="true">

            <RelativeLayout   
                android:id="@+id/bottomButtomBar"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:layout_marginTop="5dp"
                android:layout_marginBottom="5dp"
                android:orientation="horizontal">
                <Button 
                    android:id="@+id/myGroups"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="15dp"
                    android:layout_alignParentLeft="true"
                    android:layout_centerVertical="true"
                    android:text="@string/myGroups"
                    android:gravity="center"
                    android:textSize="13dp"
                    android:textColor="#000000"
                    android:background="@layout/button_meus_grupos"/>
                <Button 
                    android:id="@+id/createGroups"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_centerInParent="true"
                    android:text="@string/createGroups"
                    android:gravity="center"
                    android:textSize="13dp"
                    android:textColor="#000000"
                    android:background="@layout/button_criar_grupos"/>
                <Button 
                    android:id="@+id/configurations"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginRight="15dp"
                    android:layout_alignParentRight="true"
                    android:layout_centerVertical="true"
                    android:text="@string/configurations"
                    android:gravity="center"
                    android:textSize="13dp"
                    android:textColor="#000000"
                    android:background="@layout/button_configuracoes"/>
            </RelativeLayout>
        </LinearLayout>
        <LinearLayout 
            android:layout_above="@id/buttonBar"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:orientation="vertical" >
            <LinearLayout 
                    android:id="@+id/listContent"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical" >
                    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                        android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:background="#ffffff" 
                        android:orientation="vertical"
                    >
                        <RelativeLayout
                            android:id="@+id/searchBarLayout"
                            android:layout_width="fill_parent" 
                            android:layout_height="48dp"
                            android:orientation="horizontal"
                            android:background="#ffffff"
                            android:gravity="center_vertical"
                            android:clickable="true"
                        >
                            <TextView
                                android:id="@+id/myGroupsLabel"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="@string/myGroups"
                                android:layout_centerInParent="true"
                                android:textColor="#bdbdbd"
                                android:textSize="16dp"
                                android:textStyle="bold"
                            />
                            <ImageView
                                android:layout_alignParentRight="true"
                                android:layout_centerVertical="true"
                                android:layout_marginRight="15dp"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:background="@drawable/ic_search" />
                        </RelativeLayout>
                        <View android:layout_height="2dip" 
                            android:layout_width="wrap_content" 
                            android:background="#cccccc"  
                        />        
                        <ListView android:id="@+id/listview"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:textColor="#000000"
                            android:cacheColorHint="#000000"
                        />
                        <Button
                            android:id="@+id/buttonCreateGroup"
                            android:layout_width="200dp"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="20dp"
                            android:background="@layout/button_confirm"
                            android:layout_gravity="center_horizontal"
                            android:text="@string/createOneGroup"
                            android:textColor="#FFFFFF"
                            android:textSize="22dp"
                            android:layout_marginTop="15dp"
                        />
                    </LinearLayout>
            </LinearLayout>
        </LinearLayout>
    </RelativeLayout>
</LinearLayout>

Does anyone have any tips on how can I keep the footer fixed, scroll down until the end of the list and then show the button? I want that it looks like the button is the last item at the List.

EDIT: Entire XML posted

  • 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-15T18:07:25+00:00Added an answer on June 15, 2026 at 6:07 pm

    The only way I could achieve the exact requirements I explained above was doing the following:

    -In the XML file with the layout of the list items, I added a button with android:visibility="gone".

    -In my custom ListView adapter, I always add an empty object in the last position. I simply add an object with a flag that shows it is the last in the list.

    -In the method getView() that I override in the custom Adapter, I check if the object in the current position has the flag indicating that it is the last in the list. If so, I set the button visibility to VISIBLE, otherwise I fill the other components.

    If anyone is facing the same problem and needs some sample code from my solution just ask here.

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

Sidebar

Related Questions

I'm developing an Android application that has many activities. I have a Logout Activity
I'm developing an application on android 3.1 and I have an Activity A that
I'm developing an Android application. On one activity I have a List with list
I'm developing a simple Android application that would have an action bar on the
I'm developing an Android application with a spinner. I have this problem: This is
I'm developing an Android Application that has three very similar Activities. I would like
I am developing an android application that receives SMS messages and uses this data
I have an android application that I'm developing, and the application really just a
i have a scenario like this: I am developing an android peer to peer
i have developing an android application that requests an httpget and then it converts

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.