Android Learning Notes (5) Activity life cycle Learning

Source: Internet
Author: User

Corresponding Joshui Teacher Video Tutorial 8th lesson

Be sure to watch this video

Each activity has its life cycle, turns it on, closes it, jumps to other activity, and so on, and automatically calls one of the following methods. After these methods are covered, observe the study.

protected void OnCreate (Bundle savedinstancestate);
protected void OnStart ();
protected void Onrestart ();
protected void Onresume ();
protected void OnPause ();
protected void onStop ();
protected void ondestory ();

Overwrite method: (extrapolate)
protected void OnStart ()
{
Super.onpause ();
LOG.I ("Mainactivity", "Mainactivity-->onstart");//Only add this sentence in the original method to output the log for viewing debugging.
}

Report:
When registering activity in the manifest, add
Android:theme= "@android: Style/theme.dialog" >
will make the activity into a dialog box form.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Learning Notes (5) Activity life cycle Learning

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.