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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:26:19+00:00 2026-05-31T07:26:19+00:00

i have a listview which i have implemented in the normal manner. I want

  • 0

i have a listview which i have implemented in the normal manner. I want a editbox and a button at the top of the list view and not with every item in the list view. Could someone provide me with the sample code for this purpose

  • 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-31T07:26:21+00:00Added an answer on May 31, 2026 at 7:26 am

    Depending on what i can interpret you can try something like this:

    <?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"
        android:background="#FF000000" >
        <LinearLayout 
             android:layout_width="fill_parent"
             android:layout_height="wrap_content"
             android:id="@+id/linearLayout1"
             android:orientation="horizontal"
            >
         <EditText 
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/et1"
             />
         <Button 
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:id="@+id/bt1"
             android:text="ClickMe"
             />
         </LinearLayout>
         <ListView
            android:id="@+id/list"
            android:layout_below="@id/linearLayout1"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:divider="#000000" />
    
    
    </RelativeLayout>
    

    You might have to customize some parameter depending on your need though. Hope this helps.

    EDIT 1: The corresponding Java class

    import android.app.Activity;
    import android.os.Bundle;
    import android.widget.ArrayAdapter;
    import android.widget.ListView;
    
    public class AtoZActivity extends Activity {
        /** Called when the activity is first created. */
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.main);
            ListView lv=(ListView) findViewById(R.id.list);
            String[] values = new String[] { "Android", "iPhone", "WindowsMobile",
                    "Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X",
                    "Linux", "OS/2" };
    
                ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                    android.R.layout.simple_list_item_1, android.R.id.text1, values);
    
                // Assign adapter to ListView
                lv.setAdapter(adapter);
        }
    }
    

    And in the manifest

      <application
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name" >
            <activity
                android:label="@string/app_name"
                android:name=".AtoZActivity" >
                <intent-filter >
                    <action android:name="android.intent.action.MAIN" />
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
            </activity>
        </application>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView which displays a list of string values. I want to
I have implemented a custom list view which looks like the twitter timeline. adapter
I have implemented an adapter for my ListView which extends BaseAdapter. My list items
I have implemented a Custom List View which displays text along with image. The
I have a ListView, which can either have a context menu, or not. I
I have listView in which I inflate a row contain textview and button now
I have an activity with a listview in it. I implemented a custom list
I have implemented one up button and one down button in my layout.xml which
I have a listview which displays a list of Users (binds to UserListViewModel) -
I have ListView which is saving all data to database. For adding i have

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.