I am developing the application which consists of AutoCompleteTextView
,here is my problem,How I can upper case the letters entering in AutoCompleteTextView
.
- I Don't want in xml:
android:capitalize="characters"
- I want to declare in Java code.
I am developing the application which consists of AutoCompleteTextView
,here is my problem,How I can upper case the letters entering in AutoCompleteTextView
.
android:capitalize="characters"
You can try like this..In your text watcher in ontextchanged change the text to upper case..and check if the new string in edittext is the old string which you converted to upper case...in order to avoid stackoverflow error..
String upper = mytextview.getText().toString().toUpperCase()
mytextview.setText(upper);
Try this in your code there are some other flags also which you can check and try.
tv.setInputType(InputType.TYPE_TEXT_FLAG_CAP_CHARACTERS);