title: Android list view with empty state shrinks root view
body: <p>Hi I am developing Android application in which I am using list view with dialog fragment. I also tried to set empty view for my list view. Everything works fine, only my list view get shrink after showing empty view. I tried it in following ways:</p>
  
  <pre><code>    View emptyView = inflater.inflate(R.layout.no_result_found_layout, null, false);
      ViewGroup viewGroup= ( ViewGroup)countryListView.getParent();
      viewGroup.addView(emptyView, countryListView.getLayoutParams());
      countryListView.setEmptyView(emptyView);
  </code></pre>
  
  <p>I tried through xml as well.
          
      </p>
  
  <pre><code>    &lt;LinearLayout
          android:id="@+id/header_llt"
          android:layout_width="match_parent"
          android:layout_height="@dimen/size_100"
          android:background="@color/action_bar_color"
          android:elevation="3dp"
          android:orientation="vertical"&gt;
  
          &lt;com.newActivity.views.UbuntuMediumTextView
              android:id="@+id/header_text"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_gravity="center_horizontal"
              android:layout_margin="@dimen/margin_10"
              android:text="@string/select_country_hint_text"
              android:textColor="@color/white"
              android:textSize="@dimen/text_size_18"
              android:textStyle="bold" /&gt;
  
          &lt;EditText
              android:id="@+id/inputSearch"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginBottom="@dimen/margin_10"
              android:layout_marginLeft="@dimen/margin_10"
              android:layout_marginRight="@dimen/margin_10"
              android:drawableLeft="@drawable/abc_ic_search_api_mtrl_alpha"
              android:drawablePadding="@dimen/view_padding_normal"
              android:hint="@string/search_country_hint_text"
              android:inputType="textVisiblePassword"
              android:textColor="@color/white"
              android:textColorHighlight="@color/white_transparent"
              android:textColorHint="@color/white_transparent"
              android:textSize="@dimen/text_size_16" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;ListView
          android:id="@+id/list"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:background="@color/white"&gt;&lt;/ListView&gt;
  
      &lt;TextView
          android:id="@+id/empty_tv"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:layout_gravity="center"
          android:gravity="center"
          android:text="@string/no_result_found"
          android:textColor="@color/text_color_gray_light"
          android:textSize="@dimen/text_size_16"
          android:visibility="gone"&gt;
  
      &lt;/TextView&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Is there any way to retain width of list view after adding empty view. Need some help. Thank you</p>