title: how to align a set of button to bottom of the screen in android
body: <p>In my layout there are four sections respectively a header, an editable control, a list and a set of button.  I want to keep the buttons bottom of the screen.  I make too many changes in the layout to force the buttons to bottom.  But nothing happened.  Please provide instructions to make what i needed.  I am posting the layout also </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:orientation="vertical"&gt;
  
          &lt;!--  heading for basic settings --&gt;
          &lt;TextView
              android:id="@+id/setup_macroheading"
              style="@style/txtHeading" /&gt;
  
          &lt;View
              android:layout_width="fill_parent"
              android:layout_height="20dp"/&gt;
  
           &lt;!--  macro name --&gt;
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:paddingLeft="20dp"
              android:paddingRight="20dp"
              android:orientation="horizontal"&gt;
  
              &lt;TextView
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_gravity="left|center_vertical"
                  android:layout_weight="1"
                  android:textColor="@color/white"                    
                  android:text="Macro Name"/&gt;
  
              &lt;EditText
                  android:id="@+id/setup_macroname"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_gravity="right"
                  android:layout_weight="1"
                  android:maxLength="12"
                  android:inputType="textCapCharacters"
                  android:singleLine="true"/&gt;                 
          &lt;/LinearLayout&gt;
  
          &lt;View
              android:layout_width="fill_parent"
              android:layout_height="20dp"/&gt;
  
          &lt;ListView
              android:id="@+id/lvMacroList"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content" 
          /&gt;
  
          &lt;!-- Save &amp; Cancel button --&gt;
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:paddingLeft="20dp"
              android:paddingRight="20dp"
              android:layout_gravity="bottom"
              android:orientation="horizontal"&gt;
  
              &lt;Button
                  android:id="@+id/setup_macroSavebtn"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_gravity="left"
                  android:layout_weight="1"
                  android:onClick="onSaveButtonClick"
                  android:text="Save"/&gt;
  
              &lt;Button
                  android:id="@+id/setup_macroCancelbtn"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_gravity="right"
                  android:layout_weight="1"
                  android:onClick="onCancelButtonClick"
                  android:text="Cancel"/&gt;         
          &lt;/LinearLayout&gt;
      &lt;/LinearLayout&gt;
    &lt;/ScrollView&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/P21Mw.png" alt="enter image description here"></p>