Android custom ListView pull up/down refresh latest and load more

Source: Internet
Author: User

Content

  • Development Environment
  • Demonstrate how to pull up and down to refresh the latest and load more ListView
  • References

This article demonstrates how to pull up and down, refresh the most, and load more. This effect is very common. For example, when news and information apps pull down, load the latest information. When pushing up, before loading more.

Development Environment
  • Windows 2008 R2 64-bit
  • ADT V22.6.2

 

Demonstrate how to pull up and down to refresh the latest and load more ListView

Figure 1 left: Main Program; middle: Pull down to refresh latest; Right: Pull up to load more

The code is tedious and will not be posted ~ For specific code, please download the Demo after this article.

Note:

  • The custom control PullListView and its listening PullListViewListener. PullListView inherits the ListView and OnScrollListener, enabling the upper and lower pull ListView to refresh and load more;
  • The custom Status Control StatusView inherits LinearLayout and adds the top and bottom of the PullListView. When the PullListView is pulled up and down, the corresponding status information is displayed;
  • Status enumeration RefreshStatus indicates the type of status information.

 

References
  • Android. widget. AbsListView. OnScrollListener
  • Android. widget. ListView
  • Java. lang. Thread

 

Download Demo

Related Article

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.