Activity life cycle analysis (sequence of life cycle execution of jumps between two activity)

Source: Internet
Author: User

Notemainactivity Click to jump to Notelistactivity
We all know:
when the A interface clicks into the B interface, this time a===onpause--->onstop B===onstar T--->onresume B interface exit, a interface display, at this time b=== onPause---> onStop a=== onrestart---> onStart--->onresume

Q: But is it the life cycle of execution B that executes the life cycle of a? Or did B execute a after the execution? Answer: No.is actually
When the A interface is clicked into the B interface , onPause (a)---> onStart (B)--->onresum E (b) --->onstop (a) B interface exit, A interface display, at this time onPause (B)---> onrestart(a)---> onStart (a)---> Onresume (A)--->onstop (B)
Q: What are the practical applications? A: Give an example. A interface needs to request data from the database and display it on the interface. The operation of the B interface will affect the data of the A interface.    Returning from the B interface to the A interface requires data to be re-requested for interface display. At this point, the B interface should be where the data is submitted.    A interface where the data is read. In the B-interfaceOnPause the storage of data.
In the A-interfaceOnrestart to read and render data

Here is the log I actually printed.
notemainactivityEnter
Notemainactivity screen Dark

notemainactivityOn screen Light:

notemainactivity------>notelistactivity (click to jump)


Exit Notelistactivity, Shownotemainactivity



Exitnotemainactivity

With a avtivity life cycle diagram:



From for notes (Wiz)

Activity life cycle analysis (sequence of life cycle execution of jumps between two activity)

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.