IDs in Android layout XML with and without “+” [closed]

Frick

New Member
\[quote\] Possible Duplicate:
Difference between “@id/” and “@+id/” in Android \[/quote\]When you create a layout XML file for Android applications, you usually declare the ID of each layout element as:\[code\]@+id/elementID\[/code\]Don't you? I guess the "+" means that this element's ID is just created and therefore you need the plus, right?But what do you have to do when you refer to a layout element before it is created? Do you refer to it with "+" and then create it without "+"? Simply put, is the following code correct (in a RelativeLayout container)?\[code\]<ImageButton android:id="@+id/helpButton" android:layout_toLeftOf="@+id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" /><ImageButton android:id="@id/moreButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" />\[/code\]
 
Back
Top