1. Create an empty Android project
2. Download the Pulltorefresh from GitHub and unzip to the local directory
You'll get a directory like this when you unzip
3. First import the library into the project
Import Module, File-New
Select the Library directory under Unzip directory and click OK
Next click Next, Finish, wait for Gradle build to complete the next step, there should be no error
4. As in the previous step, add pulltorefreshlistfragment from the extra directory to the project
After clicking OK, we will be prompted that the library has been added to the project, this is the last step to introduce the library, Pulltorefreshlistfragment is dependent on the library
Always click Next, then Finish
This will prompt usesdkversion 1 can ' t be smaller than version 4, stating that a declaration needs to be displayed in the pulltorefreshlistfragment just added
Minsdkversion greater than or equal to 4
Only need to declare the minimum SDK in the Pulltorefreshlistfragment androidmanifest.xml file.
and re-build it.
5. Then press the previous step to import the Pulltorereshviewpager in the extra directory into the project, Pulltorereshviewpager is also dependent on the library
6. Finally re-import sample
Sample relies on the previously imported library,pulltorereshviewpager,pulltorereshlistfragment
All the way next, final finish
7. The following error occurs when you run sample at this time
The build tools version is incorrect.
Modify the Build.gradle file of sample to read as follows
If you do not have this version of Buildtools, open the Sdkmanager download
Here, you can run successfully.
Android Studio Import Pulltorefresh's sample