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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T21:47:19+00:00 2026-05-19T21:47:19+00:00

I have a listactivity which contains a listview. i want to show another layout

  • 0

I have a listactivity which contains a listview. i want to show another layout which contains a button at top and a webview at bottom on this listview and that layout always to be shown. I tried this but this is not what i want to do :

ListView lv =getListView();
LayoutInflater inflater = getLayoutInflater();
ViewGroup header = (ViewGroup)inflater.inflate(R.layout.mylayer, lv, false);
lv.addHeaderView(header, null, false);

This shows my layout but when i scroll my listview, needless to say that when i scroll my listview down it is no more to be shown like it is part of my other listview items.

  • 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-19T21:47:20+00:00Added an answer on May 19, 2026 at 9:47 pm

    When using ListActivity, you can use any layout you want. The only contract you must follow is putting a ListView whose id is list. Thus, you can do something like:

    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <TextView
        android:id="@+id/something"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:text="What ever"/>
    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@+id/something"/>
    </RelativeLayout>
    

    If you do want to reuse another layout, change the TextView for something like <include> (take a look at this article).

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

Sidebar

Related Questions

I have a ListActivity which I want to show when the phone's orientation is
I have a listview which contains custom rows. When I show the listview with
i have a activity which extends ListActivity. The Layout contains some generic widget an
I have a ListActivity which shows list of items. I prepared another layout for
I have made a custom listView which which extends ListActivity and each row contains
I have a ListActivity which launches another Activity based on the list selection. This
I have a ListActivity which has an adapter that crashes. Here is the code
I have two ListActivity classes that I want to pass into into a third
I have a ListView in my ListActivity which is inflated with an adapter. There
I am developing a soundboard application which extends ListActivity. I have a play button

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.