ListView Footerview not taking full width
<p>This is my footerview</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:custom="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:weightSum="1"&gt;

    &lt;Button
        android:id="@+id/button_add_location1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/margin_top_10"
        android:layout_weight="1"
        android:text="+ Add more location"
        android:textColor="@color/grey3"
        android:textSize="@dimen/size_15" /&gt;

&lt;/LinearLayout&gt;
</code></pre>

<p>Heres how I am inflating my listView footerview</p>

<pre><code> View footerView1 = View.inflate(mContext, R.layout.layout_footerview1, null);
        listView1.addFooterView(footerView1);
</code></pre>

<p>The footerView i.e the button is not taking the width as match_parent rather it is taking the width to be wrap_content.</p>

<p>Please Help me in acheiving my result. Thanks in advance.</p>