5

I see from Android Developers (http://developer.android.com/reference/android/app/Activity.html) that there is a nice flowchart showing onCreate leading to onStart then to onResume, and so forth. My question is: what other on****() methods appear in between onCreate and onStart?

For example, I've been doing research on the topic, and I know other methods such as onMeasure and onSizeChanged, onDraw, and others exists. Where do they fit in to that flow chart?

Thank you.

Deepzz
  • 4,573
  • 1
  • 28
  • 52
  • 3
    Make an activity that overrides every single one of the onX() and add a single log statement to each. Then run the activity and inspect your log. Will tell you the order that every thing happens in. – FoamyGuy Mar 13 '12 at 01:02

3 Answers3

2

The methods you mentioned aren't related to the Activity lifecycle.

For instance, it would be incorrect to include the call to onMeasure in the Activity lifecycle flow chart. onMeasure is called whenever the layout changes (i.e. when requestLayout is called) or the first time a window is laid out. The call to onMeasure isn't directly related to the system's calls to onCreate and onStart.

Alex Lockwood
  • 83,063
  • 39
  • 206
  • 250
1

Those other methods exist, but they don't really fit in any one place on that flowchart, nor are they part of the activity lifecycle. in fact, that's why they're not on the chart. The ones you mentioned are really more of the view lifecycle which is separate from (though admittedly related to) the activity lifecycle.

kabuko
  • 36,028
  • 10
  • 80
  • 93
0

Image

This image can clearly depict what you want.

aravindkanna
  • 663
  • 1
  • 7
  • 25