how to add Swipe Refresh Layout in android studio

0 2,166

Swipe Refresh Layout android pull to refresh

Swipe Refresh Layout android pull to refresh allow a user to refresh content of an app view via a vertical swipe gesture,in this tutorial I will teach you how can add SwipeRefreshLayout in your android app and change color of Swipe Refresh Layout,in this Swipe Refresh Layout example I used random no to figure out that when a user pulls to refresh how it’s getting update view in app.

Main activity

activity_main

SwipeRefreshLayout Widget

The SwipeRefreshLayout add to the single ListView or GridView as the parent and Remember one thing SwipeRefreshLayout only supports to single ListView or GridView child.
below activity_main.xml shows that how you can add SwipeRefreshLayout widget to your existing or new project.

Color

In color.xml we have defined three colors.

Comments

comments

Leave A Reply

Your email address will not be published.