Difference between revisions of "Teams Winter 2011/team1/Android/Send Email"

From CDOT Wiki
Jump to: navigation, search
(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…')
(No difference)

Revision as of 16:12, 7 April 2011

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:

<string name="emailContact_textView">Email Contact</string>

9.1.2 Now lets finish our layout email.xml.
EditContactLayout.png

9.1.3 Here is the email.xml implementation:

<?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>