Essential Android Swipe to Refresh edit forum

How to add Swipe-to-Refresh To your app

Make sure the following dependency is added to your app’s build.gradle file under dependencies:

compile 'com.android.support:support-core-ui:24.2.0'

Then add the SwipeRefreshLayout in your layout:

<android.support.v4.widget.SwipeRefreshLayout
        android:id="@+id/swipe_refresh_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

     <!-- place your view here -->       

</android.support.v4.widget.SwipeRefreshLayout>

Finally implement the SwipeRefreshLayout.OnRefreshListener listener.

mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_refresh_layout);
mSwipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
    @Override
    public void onRefresh() {
         // your code
    }
});

Table Of Contents
39 ACRA
64 Menu
112 Loader
119 Xposed
132 Colors
135 Fresco
136 Swipe to Refresh
140 AdMob
147 Button
156 Vk SDK
170 XMPP
176 OpenCV
200 FileIO
203 Moshi
217 Paint
231 AIDL
241 JCodec
243 Okio
255 Looper
  ↑ ↓ to navigate     ↵ to select     Esc to close