title: Android: requestLayout() improperly called
body: <p>The following error occurs when I attempt to inflate a layout within a <code>ListView</code>:</p>
  
  <pre><code>requestLayout() improperly called by android.widget.TextView{...} during layout: running second layout pass
  </code></pre>
  
  <p>I am attempting to inflate a layout within a <code>ListView</code> as follows:</p>
  
  <pre><code>@Override
  public View getView(int position, View convertView, ViewGroup parent) {
      if(convertView == null){
          LayoutInflater inflater = (LayoutInflater) musicActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
          convertView = inflater.inflate(R.layout.list_item, parent, false);
          ...
      }else{...}
  }
  </code></pre>
  
  <p>The layout being inflated can look as simple as the following, and will still produce the error</p>
  
  <pre><code>&lt;TextView
      android:id="@+id/txt"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:textSize="@dimen/txt_size"/&gt;
  </code></pre>
  
  <p>I have looked into similar questions, and no solutions found seem to work <a href="https://stackoverflow.com/questions/21249935/requestlayout-improperly-called-by-android-widget-relativelayout-android">Question 1</a>, <a href="https://stackoverflow.com/questions/20717022/trace-requestlayout-improperly-called">Question 2</a>, <a href="https://stackoverflow.com/questions/19170863/requestlayout-improperly-called-by-error-on-android-4-3">Question 3</a>. </p>
  
  <p>Does anyone know what causes this type of error?  Any troubleshooting advice?  For more context, this <code>ListView</code> is displayed within a <code>Fragment</code> within a <code>ViewPager</code></p>
  
  <h1>UPDATE</h1>
  
  <p>Here is the full XML Layout (minus a bunch of attributes), that still results in the problem</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent"&gt;
  
   &lt;TextView
      android:id="@+id/txt1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" /&gt;
  
   &lt;TextView
      android:id="@+id/txt2"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" /&gt;
  
   &lt;TextView
      android:id="@+id/txt3"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content" /&gt;
  
  &lt;TextView
      android:id="@+id/txt4"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Based on this, I would think the XML itself is not a problem, unless it has to do with the fact that I am using a ViewPager and Fragments</p>