开发者

Looking into the Android source, specifically around activity & service lifecycle

I want to look more into the workings of Android. More specifically I want to know how Applications (including Activities and Services) get launched by the sys开发者_如何学Gotem. I also want to be able to see who calls their lifecycle methods and how objects get allocated and recycled.

I have downloaded the Android source from git and browsed around for a bit, but since it's a little large any pointer would be appreciated.

Thanks!


You can start looking in android.app.ActivityThread it handles most of the lifecycle calls, i.e., calling onCreate, onPause, etc. Also android.app.ActivityManager is a good starting point as well.


One way to find out what is happening around an area of interest is to create a small test application, and then use the eclipse debugger. You can put break points in the areas of interest, like the lifecycle methods. Then you can see the callers, and step through the code line by line.


You can browse through the Android Source Code in Google Code search: here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜