Show navigation Hide navigation

Supporting Swipe-to-Refresh

Dependencies and prerequisites

  • Android 1.6 (API level 4) or later
  • Latest version of the Android v4 Support Library

Sample Apps

Even if your app automatically updates its content on a regular basis, you can allow users to request manual updates as well. For example, a weather forecasting app can allow users get the latest forecasts on demand. To provide a standard user experience for requesting updates, the Android platform includes the swipe-to-refresh design pattern, which allows users to trigger an update with a vertical swipe.

Note: This class requires the latest version of the Android v4 Support Library APIs. If you have not used the Support Library before, follow the instructions in the Support Library Setup document.

Lessons

Adding Swipe-to-Refresh To Your App
To replay the movie, click on the device screen
Learn how to provide swipe-to-refresh support in a ListView or GridView, and how to provide an accessible refresh option using the action bar.
Responding to a Refresh Request
Learn how to respond to the swipe-to-refresh gesture, and how to perform the same update from an action bar action.