1
edit
Changes
Created page with '== 9. Add Send Email functionality == === 9.1 Create the Email menu item === 9.1.1 Add the String value for the layout title to String.xml: <source lang="java"> <string name="e…'
== 9. Add Send Email functionality ==
=== 9.1 Create the Email menu item ===
9.1.1 Add the String value for the layout title to String.xml:
<source lang="java">
<string name="emailContact_textView">Email Contact</string>
</source>
9.1.2 Now lets finish our layout email.xml.<br/>
[[Image: editContactLayout.png | 250px]]<br/>
9.1.3 Here is the email.xml implementation:
<source lang="java">
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="30dp"
android:layout_gravity="center"
android:text="@string/emailContact_textView" />
<TextView android:id="@+id/emailTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/emailTo_textView" />
<EditText android:id="@+id/editEmailTo"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView android:id="@+id/emailSubject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/emailSubject_textView" />
<EditText android:id="@+id/editEmailSubject"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:id="@+id/emailBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/emailBody_textView" />
<EditText android:id="@+id/editEmailBody"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button android:id="@+id/emailSend"
android:layout_column="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btnEmailSend" />
</LinearLayout>
</source>
=== 9.1 Create the Email menu item ===
9.1.1 Add the String value for the layout title to String.xml:
<source lang="java">
<string name="emailContact_textView">Email Contact</string>
</source>
9.1.2 Now lets finish our layout email.xml.<br/>
[[Image: editContactLayout.png | 250px]]<br/>
9.1.3 Here is the email.xml implementation:
<source lang="java">
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textSize="30dp"
android:layout_gravity="center"
android:text="@string/emailContact_textView" />
<TextView android:id="@+id/emailTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/emailTo_textView" />
<EditText android:id="@+id/editEmailTo"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView android:id="@+id/emailSubject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/emailSubject_textView" />
<EditText android:id="@+id/editEmailSubject"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<TextView android:id="@+id/emailBody"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/emailBody_textView" />
<EditText android:id="@+id/editEmailBody"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Button android:id="@+id/emailSend"
android:layout_column="0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/btnEmailSend" />
</LinearLayout>
</source>