Android EditText Capital Characters

rizzz86 picture rizzz86 · Feb 22, 2012 · Viewed 12.1k times · Source

I have an edittext and I want any character that I type in edittext show in Capital letter. I have used this:

edittext.setInputType(InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS);

But it is not working. I want to do it dynamically. Any ideas.

Answer

Paresh Mayani picture Paresh Mayani · Feb 22, 2012

You just need to try with android:inputType attribute.

As per your requirement, you can include android:inputType="textCapCharacters"