Life cycle changes of pager pages during Viewpager switching

Source: Internet
Author: User

Summary 1: When we share viewpager and fragment, the life cycle changes when you switch pages: Load the current page, the previous page, and the next page, and we'll take a look at an actual test

Opening an app loads the first and second pages:

When we switch to the second item, Page1 and Page2 do not change, page3 load:

When we switch to the third page, Page1 will stop, Page2, 3 does not change, page4 load:

The results obtained are consistent with the above conclusions.

Summary 2: Add a jar package to the project:

If we are going to import a larger package, or a middleware company customized Android system layer for our application to do the development, do not put this package in the Libs folder, because this operation will probably put your eclipse card dead, directly on the outermost build path is possible, This will not make any impact on your running, and the apk you generate will not become much more of a summary of the problems you are experiencing at work.

Life cycle changes of pager pages during Viewpager switching

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.