This Android documentation page defines the identifier of an element as follows:
<TextView android:id="@+id/label" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Type here:" />
However, this page defines it as:
<EditText id="text" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:textColor="@color/opaque_red" android:text="Hello, World!" />
I thought I had a decent understanding of what was happening until I saw this second example. In the first case, you need the + character so that the identifier 'label' is added to the R file, right? In the second case, the EditText identifier will not be added to the R file because it does not contain the +?
In addition, the second example does not include the android namespace in id. Does or does not have an Android namespace, does this identifier affect the R file?
Thanks for any clarification.
source share