title: How to trigger swiperefreshlayout in android?
body: <p>I want to trigger my <code>SwipeRefreshLayout</code> in the event <code>onCreateView</code> of my <code>MainFragment</code>.
  What I want to do is start downloading the information in the event <code>onCreateView</code> and at the same time I show the SwipeRefreshLayout refreshing. Any ideas?</p>
  
  <p>Here is my code in my Java code in <code>MainFragment</code></p>
  
  <pre><code>@Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
              Bundle savedInstanceState) {
          View rootView = inflater.inflate(R.layout.fragment_main, container, false);
          SwipeRefreshLayout swpRfrshLyt= (SwipeRefreshLayout) rootView.findViewById(R.id.swpRfrshLyt);
  
          swpRfrshLyt.setColorSchemeResources(R.color.holo_blue_light,
                  R.color.holo_green_light,
                  R.color.holo_orange_light,
                  R.color.holo_red_light);
  
          swpRfrshLyt.setOnRefreshListener(this);
          swpRfrshLyt.setRefreshing(true);
          return rootView;
      }
  </code></pre>
  
  <p>Here is my <code>fragment_main.xml</code></p>
  
  <pre><code>&lt;android.support.v4.widget.SwipeRefreshLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/swpRfrshLyt"
      android:layout_width="match_parent"
      android:layout_height="match_parent"&gt;
  
      &lt;ListView
          android:id="@+id/lstvw_items"
          android:layout_width="match_parent"
          android:layout_height="match_parent"/&gt;
  
  &lt;/android.support.v4.widget.SwipeRefreshLayout&gt;
  </code></pre>
  
  <p>I am using Android Studio, here is my build gradle</p>
  
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:+'
      compile 'com.android.support:support-v4:+'
      compile 'com.mcxiaoke.volley:library:1.0.+'
  }
  </code></pre>
  
  <p>I have installed <code>Android SDK Build Tools 21.0.2</code></p>