In this task you will add UI support for tags. This is a simple case of adding a new
TableRow to your layout. This TableRow will contain two
TextView components. One TextView will contain a label
"Tags:", the other TextView will contain a string representing a list of tags
that the node may have applied to it.
- In the Package Explorer expand TestApp1 and navigate to res, layout.
- Double-click on activity_node_detail.xml file to load it into Eclipse.
-
Add an additional TableRow to the end of the file, so that the end of
the XML file now matches the following:
<!-- Adding tag support --> <TableRow> <TextView android:text="@string/node_tags" /> <TextView android:id="@+id/node_tags_value" /> </TableRow> </TableLayout>
- You will find that @string/node_tags is undefined, and will be highlighted in red. You can fix that next.
- In the Package Explorer expand the values folder and double-click strings.xml to load it into Eclipse.
-
Modify the bottom of the file so that it includes the node_tags
label:
<!-- Add support for tags --> <string name="node_tags">Tags:</string> </resources>
This will fix the error that was found in activity_node_detail.xml