title: How to inflate a view in android in API level 25 and below?
body: <p>I am getting error in inflating a view in recycler view. It works on Oreo and Pie but not working in Nougat and devices below it.</p>
  
  <p>This is the code I have used to inflating the view.</p>
  
  <pre><code>View itemView = LayoutInflater.from(parent.getContext())
                  .inflate(R.layout.listing_row_item, parent, false);
  </code></pre>
  
  <p>My xml file is</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:background="@drawable/outlined_blue_rectangle"
      android:clickable="true"
      android:focusable="true"
      android:orientation="vertical"
      android:layout_marginBottom="@dimen/row_padding"
      android:paddingBottom="@dimen/contentPadding"
      android:paddingStart="@dimen/contentPadding"
      android:paddingEnd="@dimen/contentPadding"
      android:paddingTop="@dimen/contentPadding"&gt;
  
      &lt;LinearLayout
          android:id="@+id/ll_name"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;TextView
              android:layout_width="0dp"
              android:layout_weight="1"
              android:text="Name"
              android:layout_height="wrap_content"
              android:textColor="@color/blackColor"
              android:textSize="@dimen/textSizeMedium" /&gt;
  
          &lt;TextView
              android:id="@+id/name"
              android:layout_weight="1"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:textColor="@color/blackColor"
              android:textSize="@dimen/textSizeMedium" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/ll_status"
          android:layout_below="@+id/ll_name"
          android:layout_marginTop="@dimen/verticalSpacing"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;TextView
              android:layout_width="0dp"
              android:layout_weight="1"
              android:text="Loan Application Status"
              android:layout_height="wrap_content"
              android:textColor="@color/blackColor"
              android:textSize="@dimen/textSizeMedium" /&gt;
  
          &lt;TextView
              android:id="@+id/status"
              android:layout_weight="1"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              android:textColor="@color/blackColor"
              android:textSize="@dimen/textSizeMedium" /&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:id="@+id/ll_eligibility"
          android:layout_below="@+id/ll_status"
          android:layout_marginTop="@dimen/verticalSpacing"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"&gt;
  
          &lt;TextView
              android:layout_width="0dp"
              android:layout_weight="1"
              android:layout_height="wrap_content"
              android:text="Eligibility Status"
              android:textColor="@color/blackColor"
              android:textSize="@dimen/textSizeMedium" /&gt;
  
          &lt;TextView
              android:id="@+id/preliminary_eligibility"
              android:layout_width="0dp"
              android:layout_weight="1"
              android:layout_height="wrap_content"
              android:textColor="@color/blackColor"
              android:textSize="@dimen/textSizeMedium" /&gt;
  
      &lt;/LinearLayout&gt;
  
      **&lt;Button**
          android:id="@+id/check_eligibility"
          android:layout_below="@+id/ll_eligibility"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginTop="@dimen/verticalSpacing"
          android:paddingStart="@dimen/row_padding"
          android:paddingEnd="@dimen/row_padding"
          android:text="Check\nEligibility"
          android:layout_alignParentEnd="true"
          android:textAllCaps="false"
          android:background="@drawable/button_selection_selected"
          android:textColor="@color/whiteColor"
          android:textSize="@dimen/textSizeSmall" /&gt;
  
      &lt;Button
          android:id="@+id/all_info"
          android:layout_below="@+id/ll_eligibility"
          android:layout_marginTop="@dimen/verticalSpacing"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:paddingStart="@dimen/row_padding"
          android:paddingEnd="@dimen/row_padding"
          android:text="All\nInfo"
          android:textAllCaps="false"
          android:background="@drawable/button_selection_selected"
          android:textColor="@color/whiteColor"
          android:textSize="@dimen/textSizeSmall"/&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>The error message I am getting</p>
  
  <pre><code>android.view.InflateException: Binary XML file line #88: Binary XML file line #88: Error inflating class Button
      Caused by: android.view.InflateException: Binary XML file line #88: Error inflating class Button
      Caused by: java.lang.ArrayIndexOutOfBoundsException: length=31; index=464
          at android.content.res.StringBlock.get(StringBlock.java:65)
          at android.content.res.XmlBlock$Parser.getPooledString(XmlBlock.java:458)
          at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:1212)
          at android.content.res.TypedArray.getString(TypedArray.java:202)
          at android.widget.TextView.&lt;init&gt;(TextView.java:1100)
          at android.widget.Button.&lt;init&gt;(Button.java:109)
          at android.widget.Button.&lt;init&gt;(Button.java:105)
          at androidx.appcompat.widget.AppCompatButton.&lt;init&gt;(AppCompatButton.java:71)
          at androidx.appcompat.widget.AppCompatButton.&lt;init&gt;(AppCompatButton.java:67)
  </code></pre>