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:
references, 5th Floor coolszy reply:
your Activity inheritance Activity, if you do not have to replicate this method, the parent class method is invoked

Execution is the parent class onStart and onResume
Reply:
references, 5th Floor coolszy reply:
your Activity inheritance Activity, if you do not have to replicate this method, the parent class method is invoked


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:
reference to the 6th floor sis_ying reply:
references, 5th Floor coolszy reply:
Your Activity inheritance Activity, if you do not replicate the method, the method will call the parent class

Execution is the parent class onStart and onResume


Phrase code execution is onStart and onResume parent class?
Reply:
reference to the 8th floor mic47 reply:
[Quote = reference to the 6th floor sis_ying reply:]
References, 5th Floor coolszy reply:
Your Activity inheritance Activity, if you do not replicate the method, the method will call the parent class

Execution is the parent class onStart and onResume


Phrase code execution is onStart and onResume parent class?
Reply:
references, 4th Floor mic47 reply:
Onstart what I'm asking is, when executed () 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?

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

No comments:

Post a Comment