Simple activity Lifecycle

Source: Internet
Author: User

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/48/36/wKiom1QGdkOzDSCCAAECZvgtw8Y746.gif "Title =" 18091212_c45n.gif "alt =" wkiom1qgdkozdsccaaeczvgtw8y746.gif "/>

Oncreate (): called when an activity is created for the first time and will not be called later.

Onstart (): called before acticity becomes visible to the user.

Onresume (): called before the activity can interact with the user. That is, it is called when actvity is visible at the top of the activity stack.

Onpause (): When the system calls other activities, data can be saved to the persistence layer in this method. To prevent the system kill activity from reclaiming memory, you can stop some processes in this method. Turn off the resources opened in onresume.

Onstop (): called when activity is invisible.

Ondestroy (): This method is called when the activity is destroyed. If acitivty calls finish () during running, the system will not directly call this method through other life processes.

Onrestart (): called when the activity in the onstop () state changes to visible.

This article is from the "7780410" blog, please be sure to keep this source http://7790410.blog.51cto.com/7780410/1548190

Simple activity Lifecycle

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.