在Android还是1.1的时候就写过一些hello world的入门,一直没有时间深入学习。昨天把相关的环境都升级到了最新(1.5),试了一下Google官方提供的Demo:Notepadv1。
在学习的时候,碰到的问题:(http://docs.google.com/Doc?id=dgj5ns3n_1103cmqpvwhb)
(1)Syntax error on tokens, delete these tokens
android:id="@android:id/list"
android:id="@android:id/empty"
Screen Layout
ListActivity has a default layout that consists of a single, full-screen list in the center of the screen. However, if you desire, you can customize the screen layout by setting your own view layout with setContentView() in onCreate(). To do this, your own view MUST contain a ListView object with the id "@android:id/list" (or list if it's in code)
Optionally, your custom view can contain another view object of any type to display when the list view is empty. This "empty list" notifier must have an id "android:empty". Note that when an empty view is present, the list view will be hidden when there is no data to display.
android:id="@+id/text1"
另外,在阅读其官方文档的时候,发现了一个关于Activity lifecycle的图片,如下:
这个对于理解Activity应该很有用处。
代码就不单独贴出来了,晚上把它svn到Google Code上。