Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable auto-capitalization of an EditText

This will have a really simple answer, but I can't seem to find what it is. I want to disable the auto-capitalization of an EditText so that, by default, the first letter entered with not be automatically capitalized. I still want to allow capitalization, but only if the user manually does so.

I've tried android:capitalize="none" on my EditText, and I've tried android:inputType="text" but both still auto-capitalize the first letter. I don't want to use a TextWatcher because on the soft keyboard it will still show the shift key as pressed for the first letter, and I'm nit-picky and don't want that to show.

like image 968
Jason Robinson Avatar asked Aug 08 '11 01:08

Jason Robinson


People also ask

How do you make EditText all caps?

You can add the android:textAllCaps="true" property to your xml file in the EditText. This will enforce the softinput keyboard to appear in all caps mode. The value you enter will appear in Uppercase.

How do I change capital to first letter in Android?

If you are using an Android phone and Gboard, you can capitalize the first letter of any word with three touches. First, double-tap the word in question to highlight the word, then tap the shift button (the up arrow) on the keyboard to capitalize the first letter. Done!

What is Imeoption Android?

android:imeOptions="actionSend" /> You can then listen for presses on the action button by defining a TextView.OnEditorActionListener for the EditText element. In your listener, respond to the appropriate IME action ID defined in the EditorInfo class, such as IME_ACTION_SEND . For example: findViewById<EditText>(R.


2 Answers

You could try using android:inputType="none" instead.

UPDATE:

You could also try using android:inputType="text|textEmailAddress"

like image 55
A. Abiri Avatar answered Oct 03 '22 08:10

A. Abiri


Have you tried android:inputType="textFilter"? That will disable all text filters, so there's no auto-correcting.

like image 42
Brian Avatar answered Oct 03 '22 06:10

Brian