I have an array of editTexts which I make like this:
inputs[i] = new EditText(this);
inputs[i].setWidth(376);
inputs[i].setInputType(
I know this question is a bit old but here is explained how to do it in different ways:
Applying UpperCase in XML
Add the following to the EditText XML:
android:inputType="textCapCharacters"
Applying UpperCase as the only filter to an EditText in Java
Here we are setting the UpperCase filter as the only filter of the EditText. Notice that this method removes all the previously added filters.
editText.setFilters(new InputFilter[] {new InputFilter.AllCaps()});
Adding UpperCase to the existing filters of an EditText in Java
To keep the already applied filters of the EditText, let's say inputType, maxLength, etc, you need to retrieve the applied filters, add the UpperCase filter to those filters, and set them back to the EditText. Here is an example how:
InputFilter[] editFilters = editText.getFilters();
InputFilter[] newFilters = new InputFilter[editFilters.length + 1];
System.arraycopy(editFilters, 0, newFilters, 0, editFilters.length);
newFilters[editFilters.length] = new InputFilter.AllCaps();
editText.setFilters(newFilters);