Everyone
Everyone

Reputation: 2376

What do the symbols '+', and '?' when referenced from resource definition signify?

Just got started w/Android on my Win 7 box after a hiatus following my first attempt.

In playing with the XML layout I see that the referencing convention defined are of the following forms

I know name is probably the identifier for the resource referenced, and the rest of each string is probably a qualifier E.g. @+id/myTextView

Here, myTextView is a name defined in another file in the same package (I think)

Specifically, what do the symbols '+', and '?' signify?

Upvotes: 1

Views: 139

Answers (2)

ferostar
ferostar

Reputation: 7082

From Android's documentation:

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)

Upvotes: 1

Related Questions