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)