Android activity Common life cycle functions

Source: Internet
Author: User

in the The Activity consists of 7 commonly used periodic functions, namely:

(i)onCreate called when the Activity object was first created

Note: from another The function is not called when activity returns to the previous activity

(ii)OnStart Call this function when Activity becomes visible

(iii)Onresume Call this method when Activity starts preparing to interact with the user

Note: can also be understood as The activity is loaded, and the user does not have a function called to the activity operation

(iv)OnPause method to be called when the system is about to start another Activity

(v) Call this method when the current Activity becomes invisible onStop

(vi)OnDestroy The method will be called before the current Activity is destroyed

Note: OnDestroy is always behind onStop when doing a back-up operation.

(vii)Onrestart This method will be called before an Activity is started again

PS: For app testing I usually use some of the online test platforms:


Android activity Common life cycle functions

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.