How can Android source code not have a main method and still run?

前端 未结 13 2456
萌比男神i
萌比男神i 2020-11-30 07:40

I\'ve seen this in a few tutorials now... but how in the world can Android source code not have a main method and still run.

For example (from http://developer.andro

13条回答
  •  遥遥无期
    2020-11-30 08:16

    I think that Jonathon's answer is going in the right direction. He says the OS expects a certain structure. There's a name for that structure which is a "state machine". In this case Android calls it the "activity lifecycle". Rob gives a link to the documentation which contains an important diagram of that state machine though the text is a bit dry. A quick search also found me the following link that explains it fairly clearly: http://www.android-app-market.com/android-activity-lifecycle.html

提交回复
热议问题