title: How do I properly set SwipeRefreshLayout on Android Studio with kotlin?
body: <p>I'm trying to use a SwipeRefreshLayout on my project, but there's something wrong... and I don't know what!
  Below I show the <code>kotlin</code> code, <code>XML</code> and the <code>error</code> I'm getting.</p>
  
  <blockquote>
    <p>NOTE, it's a FRAGMENT</p>
  </blockquote>
  
  <p><strong>KOTLIN CODE:</strong></p>
  
  <pre><code>override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          swipeRefresh.setOnRefreshListener {
              refreshAction() // refresh your list contents somehow
              swiperefresh_saloes.isRefreshing = false
          }
  }
  </code></pre>
  
  <p><strong>XML CODE</strong></p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          xmlns:app="http://schemas.android.com/apk/res-auto"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical"
          app:layout_behavior="@string/appbar_scrolling_view_behavior"
          tools:context=".Activities.Fragments.SaloesFragment"&gt;
  
          &lt;android.support.v4.widget.SwipeRefreshLayout
                  android:id="@+id/swipeRefresh"
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"&gt;
  
          &lt;android.support.v7.widget.RecyclerView
                  android:id="@+id/recyclerViewSaloes"
                  android:scrollbars="vertical"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"/&gt;
  
          &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><strong>but I'm getting the following error:</strong></p>
  
  <p><em>java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v4.widget.SwipeRefreshLayout.setOnRefreshListener(android.support.v4.widget.SwipeRefreshLayout$OnRefreshListener)' on a null object reference
          at com.zowye.b2b.Activities.Fragments.SaloesFragment.onCreate(SaloesFragment.kt:69)</em></p>