title: ListView and layout. Why ListView overlaps everything?
body: <p><strong>This is edited version!</strong> I'm new to programming Android apps and I think that this is really difficult, not the java but ui. I am trying to get a list of categories. They can be checkboxes with textview inside the listView or something else. Idea is that an user can just press the boxes/tags/checkboxes/buttons, multiselect. I ended up with checkboxes, because it felt the easiest way, any suggestions how to get easiest solution for end users? User can add categories of his own, so the last row is like button where user can add new categories.</p>
  
  <p><strong>PROBLEM</strong></p>
  
  <p>How can I get a layout where those category checkboxes not overlap settings bar, buttons etc.
  <strong>Partly solved:</strong> I changed the framelayout to LinearLayout and I changed my splash image from imageView to android:background to layout. Now I can see everything but the order is not right. If I move  topframe to top (where it should be), I got the error message like this: </p>
  
  <p><strong>ERROR:</strong> 
     java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.Button</p>
  
  <p><strong>ACTIVITY.xml</strong>
      
  </p>
  
  <pre><code>&lt;LinearLayout
      android:id="@+id/buttonContainer"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:gravity="bottom"
      android:orientation="vertical" &gt;
  
      &lt;Button
          android:id="@+id/category"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="top"
          android:layout_marginBottom="5dp"
          android:layout_marginLeft="30dp"
          android:layout_marginRight="30dp"
          android:background="@drawable/white_button"
          android:minHeight="40dp"
          android:text="@string/category"
          android:textColor="#ffffff"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/tak"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginBottom="5dp"
          android:layout_marginLeft="30dp"
          android:layout_marginRight="30dp"
          android:background="@drawable/white_button"
          android:minHeight="40dp"
          android:text="@string/take"
          android:textColor="#ffffff"
          android:textStyle="bold" /&gt;
  
      &lt;Button
          android:id="@+id/list"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_gravity="top"
          android:layout_marginBottom="5dp"
          android:layout_marginLeft="30dp"
          android:layout_marginRight="30dp"
          android:background="@drawable/white_button"
          android:minHeight="40dp"
          android:text="@string/list"
          android:textColor="#ffffff"
          android:textStyle="bold" /&gt;
  &lt;/LinearLayout&gt;
  
  &lt;LinearLayout
      android:id="@+id/topframe"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:background="#99a8b3b9" &gt;
  
      &lt;Button
          android:id="@+id/settings_button"
          android:layout_width="43dp"
          android:layout_height="37dp"
          android:background="@drawable/ic_sysbar_quicksettings" /&gt;
  
      &lt;TextView
          android:id="@+id/top_category"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginLeft="30dp"
          android:text="@string/no_category_text"
          android:textAppearance="?android:attr/textAppearanceMedium"
          android:textColor="#FFFFFF" /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>
    
  </p>
  
  <p></p>
  
  <p><img src="https://i.stack.imgur.com/o2q83.jpg" alt="enter image description here"></p>