<span id="Label3"><p>Activity has three states:<br>When it is on the screen foreground (at the top of the current task stack), it is active or running. It is the activity that responds to user Actions.<br>When it loses focus but remains visible to the user (as on the right), it is Paused. There is another activity on top of it. The activity may be transparent or not fully covered, so the suspended activity is still visible to the User. The paused activity is still alive (it retains all state and member information and remains connected to the window manager), but the activity can still be killed when the system is in very low memory.<br>Is in a stopped state when it is completely overwritten by another Activity. It still retains all the status and member Information. however, the user is invisible, so its window will be hidden, and if memory is needed elsewhere, the system will often kill the Activity.<br>These three states correspond to the life cycle of three activity respectively:<br>Full life cycle: from creation to destruction<br>OnCreate ()->onstart ()->onresume ()->onpause ()->onstop->ondestory ()<br>Visual lifecycle: invisible in the activity interface<br>OnStart ()->onresume ()->onpause ()->onstop ()->onrestart ()->onstart ()<br>Front-End life cycle: ability to interact with users when returning to focus<br>Onresume ()->onpause ()-onresume ()<br><br>In addition: the life cycle is the full life cycle of the screen Switch.<br><br>Find the corresponding activity increase in the manifest file<br>android:configchanges= "orientation|keyboardhidden|screensize"<br>You can change the activity in the screen to switch between the life Cycle.</p><p>Android activity life cycle and screen shift</p></span>
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