title: How to use the SwipeRefreshLayout?
body: <h2>Background</h2>
  
  <p>Google has recently published <a href="http://developer.android.com/tools/support-library/index.html" rel="noreferrer"><strong>an update to its support library</strong></a>, which now has a new "<a href="http://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html" rel="noreferrer"><strong>SwipeRefreshLayout</strong></a>" view. </p>
  
  <p>The view allows to wrap another view, while supporting swiping down in order to perform a refresh operation.</p>
  
  <p>screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/Stqqkl.png" alt="enter image description here"></p>
  
  <h2>The problem</h2>
  
  <p>Google hasn't provided a sample (at least not one that I can find, yet), so I've tried using it myself. </p>
  
  <p>At first I got a crash (NPE) whenever I swiped, but then I've found out that's because I didn't provide a "OnRefreshListener" for it.</p>
  
  <p>But I still don't get how to use it, let alone customize it</p>
  
  <p>Here's the XML of the layout file:</p>
  
  <pre><code>&lt;android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:id="@+id/container"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="com.example.swiperefreshlayouttest.MainActivity"
      tools:ignore="MergeRootFrame" &gt;
  
      &lt;ScrollView
          android:layout_width="match_parent"
          android:layout_height="wrap_content" &gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical" &gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="TTT"
                  android:textSize="40sp" /&gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="TTT"
                  android:textSize="40sp" /&gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="TTT"
                  android:textSize="40sp" /&gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="TTT"
                  android:textSize="40sp" /&gt;
  
              &lt;TextView
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="TTT"
                  android:textSize="40sp" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/ScrollView&gt;
  
  &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  </code></pre>
  
  <p>Code, though it doesn't do anything special at all:</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity
    {
    @Override
    protected void onCreate(final Bundle savedInstanceState)
      {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      final SwipeRefreshLayout swipeRefreshLayout=(SwipeRefreshLayout)findViewById(R.id.container);
      swipeRefreshLayout.setOnRefreshListener(new OnRefreshListener()
        {
          @Override
          public void onRefresh()
            {
            // do nothing
            }
        });
      }
    }
  </code></pre>
  
  <h2>The question</h2>
  
  <p>What is the correct way to use this view?</p>
  
  <p>How do I customize it? Currently it's just a black line...</p>