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

前端 未结 13 2463
萌比男神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:21

    There is a main of sorts, it just happens to be out of your hands. After all, there's nothing special about a main function in any language. It's just the entry point where your code starts executing. The Android operating system expects applications to have a certain structure and it calls your code based on the conventions you follow.

提交回复
热议问题