Android Swipe to Refresh How to add Swipe-to-Refresh To your app

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!


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

compile ''

Then add the SwipeRefreshLayout in your layout:


     <!-- place your view here -->       


Finally implement the SwipeRefreshLayout.OnRefreshListener listener.

mSwipeRefreshLayout = (SwipeRefreshLayout) findViewById(;
mSwipeRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
    public void onRefresh() {
         // your code

Got any Android Question?