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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:14:54+00:00 2026-05-20T16:14:54+00:00

In my custom list activity, I have added header in my list activity, it

  • 0

In my custom list activity, I have added header in my list activity, it works fine when the list is populated, when it is empty the header also gone, so is there any option to place a permanent header in the list activity.

My XML code is,

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:background="@drawable/background">

<ListView
    android:id="@android:id/list"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_weight="1"
    android:layout_marginTop="10dip"
    android:layout_marginBottom="10dip"
    android:drawSelectorOnTop="false"
    android:cacheColorHint="@color/black"/>

<TextView
    android:id="@android:id/empty"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:textSize="24dip"
    android:text="@string/empty"/>

ad_header.xml

<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:myapp="http://schemas.android.com/apk/res/com.example.Password"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical">

<ImageView
    android:id="@+id/add"
    android:layout_height="wrap_content"
    android:layout_width="fill_parent"
    android:layout_gravity="center"
    android:layout_weight="1"
    android:paddingTop="5dip"
    android:paddingBottom="5dip"
    android:src="@drawable/add_new_item"
    android:background="@color/white"/>

Thanks.

  • 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-20T16:14:55+00:00Added an answer on May 20, 2026 at 4:14 pm

    Here is another thread related to your question Android: Adding static header to the top of a ListActivity

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

Sidebar

Related Questions

I have a custom list, and I've added a 'Page Image' field by clicking
I have an activity with a ListView which is populated through a custom ArrayAdapter.
I have an activity with a listview in it. I implemented a custom list
I have list activity with custom array adapter and I can't to get context
i have my listview activity that works pretty fine but i have an annoying
I am developing a custom list-search tool. I have multiple custom properties to retain
I have a custom list menu style but I am unsure how to align
I have created a custom list as a feature in sharepoint. i need to
I have defined a custom list template type for SharePoint . I install it
I have a custom list in SharePoint (specifically, MOSS 2007.) One field is a

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.