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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:52:37+00:00 2026-05-31T14:52:37+00:00

when i use linearlayout everything works like its supposed except my button is at

  • 0

when i use linearlayout everything works like its supposed except my button is at the top and not the bottom of the screen.

when i use relativelayout my button is on the bottom like its supposed to but only works for the first listview entry after that it stops working…

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" 
android:layout_height="wrap_content"
android:orientation="vertical">

<Button android:id="@+id/plus"
android:background="@drawable/selector"
android:layout_width="fill_parent"
android:layout_height="75dp"
android:layout_alignParentBottom="true"
/>

<ListView 
    android:id="@android:id/list" 
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" 
>

</ListView>



  <TextView android:id="@android:id/empty" android:layout_width="wrap_content"
   android:layout_height="wrap_content" android:text="@string/helptxt1"

  />


    </RelativeLayout>

..

 public void addListenerOnButton() {

    final Context context = this;

    button1 = (Button) findViewById(R.id.plus);

    button1.setOnClickListener(new OnClickListener() {

    //  @Override
        public void onClick(View arg0) {


            createNote();
        //    Intent intent = new Intent(context, QuoteEdit.class);
            //            startActivity(intent);   

        }

    });

 }


private void createNote() {
Intent i = new Intent(this, QuoteEdit.class);
startActivityForResult(i, ACTIVITY_CREATE);

}
  • 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-31T14:52:38+00:00Added an answer on May 31, 2026 at 2:52 pm

    Your buttons wont work because when you use a Relative layout all the views/buttons are placed in the same location unless you place them above or below each other. Try doing this with your layout:

    <Button
        android:id="@+id/plus"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true" />
    
    <ListView
        android:id="@android:id/list"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_above="@+id/plus" >
    </ListView>
    

    or you can add an onClick to your button:

     <Button
        android:id="@+id/plus"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:onClick="myClickMethod" />
    

    and in your code

     public void myClickMethod(View view) {
    
          createNote();
    
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use Java ( not XML ) to create a LinearLayout with
I created LinearLayout and Button via class not via XML. I know how to
I want to use selector for a layout and image view..But it is not
I have a form with a format of: <LinearLayout> <RelativeLayout>TextView EditText Button</RelativeLayout> <RelativeLayout>TextView EditText
Maybe it is not the best approach, but my application use onCreate for loading/preparing
I would like to use a SimpleAdapter instead of customizing an ArrayAdapter. Everything is
use this website a lot but first time posting. My program creates a number
I'm trying to use a 9-patch drawable as the background of a LinearLayout. when
I use TableLayout with android. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical android:layout_width=fill_parent android:layout_height=fill_parent> <TableLayout
I use the following main.xml for my app. <?xml version=1.0 encoding=utf-8?> <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=fill_parent

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.