Saturday, March 5, 2011

The @+id reference

I didn't understand what the + was doing in the "@+id " naming convention for a new resource in an xml file.

Finally I found the the article in the documentation in http://developer.android.com/guide/topics/ui/declaring-layout.html

From documentation:
android:id="@+id/my_button"
The at-symbol (@) at the beginning of the string indicates that the XML parser should parse and expand the rest of the ID string and identify it as an ID resource. The plus-symbol (+) means that this is a new resource name that must be created and added to our resources (in the R.java file).

No comments:

Post a Comment