IME Demo 2 : IME « Core Class « Android






IME Demo 2

  


package com.commonsware.android.imf.two;

import android.app.Activity;
import android.os.Bundle;

public class IMEDemo2 extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}


//res\layout\main.xml
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
>  
  <TableLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1"
    >
    <TableRow>  
      <TextView  
        android:text="No special rules:"
      />
      <EditText
      />
    </TableRow>
    <TableRow>  
      <TextView  
        android:text="Email address:"
      />
      <EditText  
        android:inputType="text|textEmailAddress"
        android:imeOptions="actionSend"
      />
    </TableRow>
    <TableRow>  
      <TextView  
        android:text="Signed decimal number:"
      />
      <EditText  
        android:inputType="number|numberSigned|numberDecimal"
        android:imeOptions="actionDone"
      />
    </TableRow>
    <TableRow>  
      <TextView  
        android:text="Date:"
      />
      <EditText  
        android:inputType="date"
      />
    </TableRow>
    <TableRow>  
      <TextView  
        android:text="Multi-line text:"
      />
      <EditText  
        android:inputType="text|textMultiLine|textAutoCorrect"
        android:minLines="3"
        android:gravity="top"
      />
    </TableRow>
  </TableLayout>
</ScrollView>

   
    
  








Related examples in the same category

1.IME Demo 1