Android Studio Import Pulltorefresh's sample

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.