title: Null Pointer Exception only happens on KitKat
body: <p>My app has a small problem. In settings fragment, pressing the back button or back arrow on navBar will cause a crash. This only happens on API 19. I am using Navigator and Settings androidX components. I made sure I am using latest everything, from gradle to androidX modules. My minimum API is 19, because I expect some old devices to be used with this app. I am completely clueless as to where the problem might be and the only solutions are to either bear it (just restart the app every time you go into settings) or raise the min API level to 21.</p>
  
  <p>A piece of MainScreen fragment where the crash occurs so [What is a NullPointerException, and how do I fix it][1] does not help:</p>
  
  <pre><code>override fun onCreateView(
      inflater: LayoutInflater, container: ViewGroup?,
      savedInstanceState: Bundle?
  ): View?
  {
      //crash happens here, but only when returning from settings
      val view = inflater.inflate(R.layout.fragment_main_screen, container, false) 
      setHasOptionsMenu(true)
      view.button_newEntry.setOnClickListener {
          view.findNavController().navigate(R.id.action_mainScreen_to_newEntry)
      }
  
      return view
  }
  </code></pre>
  
  <p>Seems to fail during second inflation of the MainScreen view, no idea why. Works fine on newer versions.</p>
  
  <p>Edit: As requested, mainScreen.xml Also I know what nullPointerException is so [What is a NullPointerException, and how do I fix it?][1] does not help:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context=".Fragments.MainScreen"&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;ProgressBar
              android:id="@+id/uploadProgressBar"
              style="@style/Widget.AppCompat.ProgressBar.Horizontal"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/searchView" /&gt;
  
          &lt;SearchView
              android:id="@+id/searchView"
              android:layout_width="0dp"
              android:layout_height="wrap_content"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toTopOf="parent" /&gt;
  
          &lt;androidx.recyclerview.widget.RecyclerView
              android:id="@+id/rw_items"
              android:layout_width="0dp"
              android:layout_height="0dp"
              android:isScrollContainer="true"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent"
              app:layout_constraintStart_toStartOf="parent"
              app:layout_constraintTop_toBottomOf="@+id/uploadProgressBar"
              tools:listitem="@layout/item" /&gt;
  
          &lt;com.google.android.material.floatingactionbutton.FloatingActionButton
              android:id="@+id/button_newEntry"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_marginEnd="16dp"
              android:layout_marginBottom="16dp"
              android:background="#00FFFFFF"
              android:clickable="true"
              android:focusable="true"
              android:src="@android:drawable/ic_input_add"
              android:visibility="visible"
              app:backgroundTint="#3F51B5"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintEnd_toEndOf="parent" /&gt;
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  &lt;/FrameLayout&gt;
  </code></pre>
  
  <p>Full error message: </p>
  
  <pre><code>    Process: sk.tuke.archivator, PID: 5329
      android.view.InflateException: Binary XML file line #22: Error inflating class &lt;unknown&gt;
          at android.view.LayoutInflater.createView(LayoutInflater.java:621)
          at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:670)
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:695)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:756)
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:759)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
          at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
          at sk.tuke.archivator.Fragments.MainScreen.onCreateView(MainScreen.kt:43)
          at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)
          at androidx.fragment.app.FragmentManagerImpl.addAddedFragments(FragmentManagerImpl.java:2100)
          at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1874)
          at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1830)
          at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
          at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)
          at android.os.Handler.handleCallback(Handler.java:733)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:136)
          at android.app.ActivityThread.main(ActivityThread.java:5017)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
          at dalvik.system.NativeStart.main(Native Method)
       Caused by: java.lang.reflect.InvocationTargetException
          at java.lang.reflect.Constructor.constructNative(Native Method)
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
          at android.view.LayoutInflater.createView(LayoutInflater.java:595)
          at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:670) 
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:695) 
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) 
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) 
          at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
          at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
          at sk.tuke.archivator.Fragments.MainScreen.onCreateView(MainScreen.kt:43) 
          at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600) 
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881) 
          at androidx.fragment.app.FragmentManagerImpl.addAddedFragments(FragmentManagerImpl.java:2100) 
          at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1874) 
          at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1830) 
          at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727) 
          at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150) 
          at android.os.Handler.handleCallback(Handler.java:733) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:136) 
          at android.app.ActivityThread.main(ActivityThread.java:5017) 
          at java.lang.reflect.Method.invokeNative(Native Method) 
          at java.lang.reflect.Method.invoke(Method.java:515) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
          at dalvik.system.NativeStart.main(Native Method) 
       Caused by: java.lang.NullPointerException
          at android.widget.SearchView.onRtlPropertiesChanged(SearchView.java:1359)
          at android.view.View.resolvePadding(View.java:12407)
          at android.view.ViewGroup.resolvePadding(ViewGroup.java:5665)
          at android.view.View.initializeScrollbars(View.java:4239)
          at android.view.View.&lt;init&gt;(View.java:3934)
          at android.view.ViewGroup.&lt;init&gt;(ViewGroup.java:470)
          at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:176)
          at android.widget.LinearLayout.&lt;init&gt;(LinearLayout.java:172)
          at android.widget.SearchView.&lt;init&gt;(SearchView.java:245)
          at java.lang.reflect.Constructor.constructNative(Native Method) 
          at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 
          at android.view.LayoutInflater.createView(LayoutInflater.java:595) 
          at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:670) 
          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:695) 
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:756) 
          at android.view.LayoutInflater.rInflate(LayoutInflater.java:759) 
          at android.view.LayoutInflater.inflate(LayoutInflater.java:492) 
          at android.view.LayoutInflater.inflate(LayoutInflater.java:397) 
          at sk.tuke.archivator.Fragments.MainScreen.onCreateView(MainScreen.kt:43) 
          at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600) 
          at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881) 
          at androidx.fragment.app.FragmentManagerImpl.addAddedFragments(FragmentManagerImpl.java:2100) 
          at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1874) 
          at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1830) 
          at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727) 
          at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150) 
          at android.os.Handler.handleCallback(Handler.java:733) 
          at android.os.Handler.dispatchMessage(Handler.java:95) 
          at android.os.Looper.loop(Looper.java:136) 
          at android.app.ActivityThread.main(ActivityThread.java:5017) 
          at java.lang.reflect.Method.invokeNative(Native Method) 
          at java.lang.reflect.Method.invoke(Method.java:515) 
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 
          at dalvik.system.NativeStart.main(Native Method) ```
  
  
    [1]: https://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it
  </code></pre>