EditText AutoCorrect

Description

The EditText control is a subclass of TextView, and it allows us to do text editing.

One of properties of an EditText is the inputType. You can set the inputType property to textAutoCorrect have the control correct common misspellings.

Example


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">
/*from   w w  w. java 2s . c o m*/
    <EditText
        android:id="@+id/myEditText"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:inputType="textAutoCorrect" />

</LinearLayout>

Java code


package com.java2s.app;
/*from w  w  w .  j a va  2s. c  om*/
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
public class MainActivity extends Activity
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

    }

}
EditText AutoCorrect




















Home »
  Android »
    Android UI »




UI Basics
Action Bar
Animation
Button
Canvas
CheckBox
Clock Date Picker
Dialog
EditText
Event
Fragment
Gesture
GridView
ImageView
Layout
ListView
Map
Menu
Model
OpenGL
ProgressBar
RadioButton
Spinner
Tab
TextView
Thread
Toast
Video
View
WebView