1
edit
Changes
→8.1 Create Edit Layout and Menu Item
== 8. Edit Contact ==
===8.1 Create Edit Layoutand Menu Item===8.1.1 Add the String value for the layout title to String.xml:===
<source lang="java">
<string name="editContact_textView">Edit Contact</string>
</LinearLayout>
</source>
8.1.6Now Add the Edit menu Item. for this purpose click on menu.xml and brouse to the xml view, and add the menu item. Here is how it looks like:<source lang="java"><?xml version="1.0" encoding="utf-8"?><menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/item1" android:title="Add Student"></item> <item android:id="@+id/item2" android:title="Delete Student"></item> <item android:id="@+id/item3" android:title="View Student"></item> <item android:id="@+id/item4" android:title="Edit Student"></item> <item android:id="@+id/item5" android:title="Send E-mail"></item></menu></source> 8.1.. Now build your project so that the ids are generated in R.java
===8.2 Create EditContactActivity===
8.5.1 Build and run the project. Scrole mous buton to select a contact, and then click on the menu button of the virtual device. and then click on the EditContact menu option. Please note that the selected contact seems unselected but it's ok:<br/>
[[Image: editMenuOption.png | 450px]]<br/>
8.5.2 the Edit Contact view will apear with the selected student shown.<br/>
[[Image: editView.png | 450px]]<br/>
8.5.3 edit the Contact's info:<br/>