When declaring the id there is a "+" sign but when referencing it there is no sign. Why is that? What is the function of the + sign?
<TextView
android:id="@+id/label"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Type here:"/>
<EditText
android:id="@+id/entry"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:drawable/editbox_background"
android:layout_below="@id/label"/>
The + creates an id that lets you reference the TextView and EditText objects in your java code. So if you wanted to access the TextView you created in your java code, you could access it via R.id.label. And the EditText can be accessed via R.id.entry
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With