Friday, February 7, 2014
When the program execution Onstart () and Onresume ()? Online! ! ! ! ! ! ! ! ! ! ! ! ! ! 1
If my program is
public class mainActivity extends Activity
{
public void OnCreat () {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
}
}
Which did not perform OnStart () and OnResume (), how the simulator will enforce it?
When Onstart execute () and Onresume it?
Online! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
Reply:
Normal startup procedure: onCreate () -> onStart () -> onResume ();
Normal exit: onPause () -> onStop () -> onDestory ()
An Activity starts another Activity: onPause () -> onStop (), and then return: onRestart () -> onStart () -> onResume ()
Press back to exit the program: onPause () -> onStop () -> onDestory (), then enter: onCreate () -> onStart () -> onResume ();
Press home to exit the program: onPause () -> onStop (), then enter: onRestart () -> onStart () -> onResume ();
Reply:
onCreate is executed after onStart, and the screen has been displayed, but can not interact; then perform onResume, then you can interact with users of the.
Log plus a look at it, could not perform onStart, onResume your view on the show.
Reply:
Nor deep understanding of life cycle
Reply:
I asked what time is Onstart execution () and Onresume (). . . . . .
I did not write program code Onstart () and Onresume (). . . . . . . . . .
Perform the entire procedure from the beginning mainActivity right?
The following execution onCreat (), then the program will execute over ah?
Not running start, resume, pause, stop, destroy ah?
Reply:
Your Activity inheritance Activity, if you do not replicate the method, it is the parent class method calls
Reply:
Execution is the parent class onStart and onResume
Reply:
A subclass inherits a parent class, as my Activity inherit Activity. So, if there is no replication subclass superclass method, then the sub-class will automatically call the parent class's way?
If not, you have the wrong reply logical problems.
Reply:
Phrase code execution is onStart and onResume parent class?
Reply:
Phrase code execution is onStart and onResume parent class?
Reply:
Subclass does not override, the parent class is called the direct method of the Activity
Reply:
This is a multi-state object-oriented
Reply:
Understand, now know
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment