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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:22:22+00:00 2026-05-24T01:22:22+00:00

By using the following code. BuyActivity.java public class BuyActivity extends ListActivity { public void

  • 0

By using the following code.

BuyActivity.java

public class BuyActivity extends ListActivity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.transaction_list_view);        
        OrderAdapter orderAdapter = new OrderAdapter(this, 
            R.layout.custom_row_view, new ArrayList<Object>());
        setListAdapter(orderAdapter);        
        orderAdapter.add(new Object());
        orderAdapter.add(new Object());    
    }
}

transaction_list_view.xml

<?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">
    <ListView android:id="@id/android:list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="2"
        android:drawSelectorOnTop="false">
    </ListView>
    <TextView android:id="@id/android:empty"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:text="No data"
    />  
</LinearLayout>

custom_row_view.xml

Please refer to custom_row_view.xml

I was able to get the following outcome.

enter image description here

Besides list, I would also like to have a static label at the bottom of ListActivity.

I try

transaction_list_view.xml

<?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">
    <ListView android:id="@id/android:list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="2"
        android:drawSelectorOnTop="false">
    </ListView>
    <TextView android:id="@id/android:empty"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:text="No data"
    />
    <TextView
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
        android:text="THIS IS TOTAL STATIC LABEL"
    />  
</LinearLayout>

But I am getting

enter image description here

What my expectation is

enter image description here

Is there anything I had missed out?

  • 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-24T01:22:23+00:00Added an answer on May 24, 2026 at 1:22 am

    You have indicated that your ListView is supposed to fill_parent in the vertical orientation, leaving no room for your other widgets. Your weight is being ignored. You probably want to have your android:layout_height be 0dip instead.

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

Sidebar

Related Questions

friends, i am using following code inside asyncTask public class AsycLoaderFromDbAndMapInjector extends AsyncTask {
I have using following code to set a thread on button action. public void
I am using following code and want to know whether we require to set
I'm using following code in my app: Calendar tmpCalendar = Calendar.getInstance(Locale.getDefault()); String itemTime =
I am loading a dll in python using following code: if os.path.exists(dll_path): my_dll =
I am sharing title, image and description of post in Facebook using following code
I am trying to develop Help Bar in HTML for which i am using
I’m writing some IL institutions for creating int and double arrays using System.Reflection.Emit name
friends, i am facing a problem i have phoneContacts list with name and phone
I am creating a game which have similar concept like Tap Tap Ant .

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.