Changes

Jump to: navigation, search

Teams Winter 2011/team1/Android/Edit Contact

1,584 bytes added, 12:01, 7 April 2011
8. Edit Contact
8.1.2 Right click on layout -> New -> Android XML File .<br/>
8.1.3 Enter edit.xml for the file name and check Layout:<br/>
8.1.4 Using Linear Layout, create this layout for editing contact information:<br/>[[Image: editContactLayout.png | 450px]]<br/>
8.1.5 Here is the edit.xml implementation:
<source lang="html4strict">
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/titleTextViewEdit"
android:gravity="center_vertical" android:textSize="30dp"
android:layout_gravity="center" android:text="@string/editContact_textView"></TextView>
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_marginBottom="3dp" android:hint="@string/hint_first_name" android:id="@+id/firstNameEdit"></EditText>
 
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content" android:isScrollContainer="true"
android:layout_marginBottom="3dp" android:hint="@string/hint_last_name" android:id="@+id/lastNameEdit"></EditText>
 
<EditText android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_marginBottom="3dp" android:hint="@string/hint_email" android:id="@+id/emailEdit"></EditText>
 
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content" android:id="@+id/saveContact_buttonEdit"
android:text="@string/saveButton" android:gravity="center_horizontal"
android:layout_gravity="center_horizontal" android:textSize="20dp"></Button>
</LinearLayout>
</source>
'''8.2 Create EditContactActivity '''<br/>
1
edit

Navigation menu