Saturday, August 30, 2008

@android:id vs @+id - some information found

After doing some reading through the documentation, I found a little more information regarding the use of @android:id. The relevant documentation indicates that @android:id/list and @android:id/empty are two special cases required for a ListActivity. So, perhaps @android:id refers to a predefined android identity - hence the reason why these ids are not inserted into the R.java file. @+id is used to indicate that the id should be placed into the R.java file. Not sure if this is the case, but it seems to work in my current mental model of the platform fits together, so until I find out otherwise, I will make this assumption.

As a side note, it appears that the documentation for ListActivity is slightly wrong - it specifies ListView id="android:list" and I think it should be ListView id="@android:list".

No comments: