Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Edit Text without Autocorrect

I want an EditText without the autocorrection. I have set the textNoSuggestions inputType, as shown:

 <EditText
    android:id="@+id/txtTarga"
    android:layout_width="150dp"
    android:layout_height="wrap_content"
    android:ems="10"
    android:hint="Targa"
    android:inputType="textNoSuggestions|textCapCharacters" >

The capitalize flag works, but it is still autocorrecting.

How can I disable it?

like image 279
Lorenzo Avatar asked Jun 03 '12 11:06

Lorenzo


People also ask

How do I make Text editable in Android?

Set the Text of Android EditText In android, we can set the text of EditText control either while declaring it in Layout file or by using setText() method in Activity file. Following is the example to set the text of TextView control while declaring it in XML Layout file.

How do I disable editing in edit Text?

To disable an EditText while keeping this properties, just use UI. setReadOnly(myEditText, true) from this library. If you want to replicate this behaviour without the library, check out the source code for this small method.


2 Answers

inputType textVisiblePassword will do the trick (most of the times, because as Commonsware pointed out, it stays a request and you'll might find yourself finding devices where it works, and devices where it doesn't work)

like image 101
vanleeuwenbram Avatar answered Nov 15 '22 08:11

vanleeuwenbram


android:inputType="textNoSuggestions"

according to this, inputType attribute may or may not be supported by some devices .

However, this seems to work more often

android:inputType="textNoSuggestions|textVisiblePassword"
like image 45
K_Anas Avatar answered Nov 15 '22 09:11

K_Anas