2013年7月25日星期四

When program execution Onstart () and Onstart ()

my program is
public class mainActivity extends Activity
{
public void OnCreat () {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
}
}

which does not execute OnStart () and OnResume (), how the simulator will enforce it?

When executed Onstart () and Onresume it?

Online! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !



------ Solution ------------------------------------ --------
program start: onCreate () -> onStart () -> onResume ();
normal exit: onPause () -> onStop () -> onDestory ()

an Activity starts another Activity: onPause () -> onStop (), and then return: onRestart () -> onStart () -> onResume ()

program at back exit: onPause () -> onStop () -> onDestory (), and then enter: onCreate () -> onStart () -> onResume ();
exit the program at home: onPause () -> onStop (), and then enter: onRestart () -> onStart () -> onResume ();


------ Solution ------------------------------------ --------
onCreate and then will perform onStart, this time the screen has been displayed, but can not interact; then perform onResume, then you can interact with the user.
plus Log look at it, could not perform onStart, onResume your view on the show.
------ Solution ---------------------------------------- ----
on the life cycle of understanding is not deep
------ Solution -------------------------- ------------------
your Activity inheritance Activity, if you do not replicate the method, it will call the parent class method
----- - Solution --------------------------------------------
< br /> is running in the parent class onStart and onResume
------ For reference only ------------------------- --------------
I asked what time execution Onstart () and Onresume (). . . . . .

I did not write the program code Onstart () and Onresume (). . . . . . . . . .

entire program execution is started from mainActivity right?

following execution onCreat (), and then finished on the implementation of the program?

not running start, resume, pause, stop, destroy?
------ For reference only -------------------------------------- -


a subclass inherits a parent class, such as the inheritance of my Activity Activity. So, if there is no replication subclass superclass method, the sub-class will automatically call the parent class's methods do?

If not, you have the wrong reply logical problems.
------ For reference only -------------------------------------- -


phrase code execution is the parent class onStart and onResume?
------ For reference only -------------------------------------- -


phrase code execution is the parent class onStart and onResume?
Yes execution is the parent class onStart and onResume.

没有评论:

发表评论