XML Code (Toast Messages and Notifications)

Place the following code in: res/layout/activity_main.xml


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:background="#000000"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:padding="10sp">

  <LinearLayout
    android:orientation="horizontal"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <TextView  
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content"
      android:textSize="20sp"
      android:textColor="#FFFFFF"
      android:text="Name:" />
    
    <EditText  
      android:id="@+id/userName"
      android:layout_width="150sp" 
      android:layout_height="wrap_content"
      android:layout_marginLeft="10dp"
      android:textColor="#000000"
      android:background="@android:drawable/editbox_background"
      android:padding="10sp"
      android:inputType="text"
      android:text="Bill Rosener"/>
    </LinearLayout>

  <Button
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:id="@+id/displayToast"
    android:textSize="18sp"
    android:layout_marginTop="15dp"
    android:background="@android:drawable/btn_default"
    android:text="Display Toast Message" >
  </Button>
    
</LinearLayout>