title: ListView footer width
body: <p>I have a problem with an footer for the listview(I can't center the footer).</p>
  
  <p>I'm using a footer for an endless list.</p>
  
  <p>The problem I'm having is that the footer is not stretched to match the list width(instead is somehow using wrap_content).</p>
  
  <p>This is the footer layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/footer_layout"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="center_horizontal"
      android:gravity="center"
      android:padding="10dp" &gt;
  
      &lt;ProgressBar
          android:id="@+id/progressBar"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_gravity="center_vertical" /&gt;
  
      &lt;TextView
          android:id="@+id/textView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:padding="5dp"
          android:text="Loading more..." /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>And this is how I add the footer to the listview:</p>
  
  <pre><code>View footerView;
  
  ...     
  
  // Get the custom layout for footer
          footerView = getActivity().getLayoutInflater().
                  inflate(R.layout.list_footer_load_more, getListView(), false);
          LinearLayout footerViewLayout = (LinearLayout) footerView.findViewById(R.id.footer_layout);
          // Adding custom view to ListView at footer
          getListView().addFooterView(footerViewLayout, null, false);
  </code></pre>
  
  <p>And this is how the final result looks like:
  (I can't post images on stackoverflow, but here is an outside link to the image)
  <a href="http://s21.postimg.org/3zkd7pic7/listview_footer_problem.png" rel="nofollow">http://s21.postimg.org/3zkd7pic7/listview_footer_problem.png</a></p>
  
  <p>I tried everything to center the footer but nothing worked. I'm hoping someone can help me, because this is stressing me out for some time.</p>
  
  <p>Thank you.</p>