Android: id, which is a plus for

The document states "@ [+] id / myid" as the definition for android: id, from the notation it indicates that plus is optional. But nowhere can I find a definition of what the plus sign means or does not give it.

What does this mean and why is it?

+43
android
Jan 13 '10 at 19:44
source share
2 answers

@ + id / foo means that you are creating an identifier named foo in the namespace of your application. You can access it using @ id / foo. @android: the identifier / Foo means that you mean the identifier defined in the android namespace. This namespace is the namespace of the structure. In this case, you need to use @android: id / list and @android: id / empty, because it is the Identifier that the structure expects to expect (the structure knows only about identifiers in the android namespace.)

Taken from one of the discussions Android Developer> Google Groups .

+27
Jan 13 '10 at 19:53
source share

The documentation says:

A plus sign (+) means that this is a new resource name that must be created and added to our resources (in the R.java file). There are a number of other ID resources that are offered by the Android platform. when referring to the Android resource identifier, you do not need a plus sign, but you must add the android package namespace, for example:

android:id="@android:id/empty" 
+20
Jan 13 '10 at 19:52
source share



All Articles