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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:01:22+00:00 2026-05-25T23:01:22+00:00

When my Activity loads, I inflate a layout file that I use for a

  • 0

When my Activity loads, I inflate a layout file that I use for a footer. I attach it to the ListView (addFooterView) and then set its visibility to View.GONE. I maintain a reference to it, and when I want the user to see it, I set the visibility to View.VISIBLE.

For the most part, this works great. However, the footer seems to still take up space. If the user uses the scroll wheel/pad, the area the footer is taking up gets highlighted. I’d like to polish this more so the footer is completely gone; ideally without detaching it from the ListView.

Is this possible? Or am I going to have to set/unset the foot instead of simply toggling its visibility?

  • 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-05-25T23:01:23+00:00Added an answer on May 25, 2026 at 11:01 pm

    You can use listView.removeFooterView(view). The easiest way to do this is to create an instance variable to hold your inflated footer view (so you only inflate it in onCreate() ). Then just call listView.addFooterView(instanceFooter) and listView.removeFooterView(instanceFooter) as needed.

    Edit:
    Here’s what I’m doing to get this to work:

    1. inflate footer layout(s) in onCreate
    2. onResume: IF the adapter has not been instantiated, call addFooterView() THEN initialize your adapter (keep an instance reference to it) and call setAdapter(). This will leave the ListView “prepped”
    3. onResume: update the adapter with the data (I have my data in a separate class) and call notifyDatasetChanged()
    4. Call removeFooterView() (it will hide it if it’s being displayed and do nothing otherwise)
    5. Call addFooterView() if the footer needs to be displayed
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to just make an activity that simply loads a random image when
The first Activity that loads in my application is an initialization activity, and once
Hi Having an activity that loads a twitter feed. Android Twitter String to Json
I got an Activity that when it starts, it loads an image from the
I have an activity with listview and attached footer. I created my custom adapter
When my ListView activity loads it creates the Adapter which fills the screen as
I have various pieces of generated HTML/JS that I load into Activity with WebView#loadDataWithBaseURL.
I have an activity that lets the user load some data when they press
The main activity includes some variables with set values. I created a sub-activity with
I have an Activity in Android, with two elements: EditText ListView When my Activity

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.