title: How can I toggle position of listview on button click
body: <p>I have a list view with initially place above the button, but on clicking of the button I want button to be placed on top of listview. Below is the xml. Any help will be appreciated.</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:id="@+id/parentView"
  android:layout_height="match_parent"
  tools:context=".MainActivity" &gt;
  
       &lt;ListView
          android:id="@+id/likes_list"
          android:layout_width="wrap_content"
          android:layout_height="100dp"
          android:padding="20dp" /&gt;       
  
      &lt;ListView
          android:id="@+id/comments_list"
          android:layout_width="wrap_content"
          android:layout_height="100dp"
          android:padding="20dp" /&gt;
  
      &lt;Button
          android:id="@+id/like_button"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_below="@+id/likes_list"
          android:text="Likes"
          android:onClick="onClickLikeButton"  /&gt;
  
      &lt;Button
          android:id="@+id/comment_icon"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/likes_list"
          android:layout_toRightOf="@+id/like_button"
          android:text="Comments" 
          android:onClick="onClickCommentButton" /&gt;
  </code></pre>
  
  <p></p>