tags:

views:

21

answers:

1

I have an EditText. The softkeypad should popup as "Caps on" state, when I want to edit the editText. Is there any way to do this ?

A: 

Look at the InputType property of the TextView class. Depending on what you exactly need, TYPE_TEXT_FLAG_CAP_CHARACTERS, TYPE_TEXT_FLAG_CAP_SENTENCES or TYPE_TEXT_FLAG_CAP_WORDS should do the job. You can set it either in the layout file or via code.

Flo
thank you very much for the response. I used android:capitalize="character" for overriding caps off to caps on softpad. I can also input small letters by pressing alt. In the same way is there any option to override default alphabet softpad to number softpad. But I also want to change from number to alphabet.
Harikrishnan R
First be aware that the property Capitalize is deprecated. It's very likely that it will be removed in a future Android version. The SDK says you should use InputType instead. I think there is no way to set a standard softkeypad to number input mode while still being able to accept letters. If you know the first character is always a number, then you can initialize with InputType number and change it back to normal mode when the first character (a number) was entered. You listen for text changes with a TextWachter.
Flo