October 2018
Intermediate to advanced
464 pages
15h 17m
English
First, we need to add the SwipeRefreshLayout widget and ListView to the activity layout, then we will implement the refresh listener in the Java code. Here are the detailed steps:
<?xml version="1.0" encoding="utf-8"?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/swipeRefresh" android:layout_width="match_parent" android:layout_height="match_parent" ...