G
G
GautherKukla2020-04-26 12:17:23
Android
GautherKukla, 2020-04-26 12:17:23

How to "cap" the first character on the keyboard key if the text is displayed via onText?

if (isCaps)
 getCurrentInputConnection().commitText(text.toString().toUpperCase(), 1);

this code in the onText method converts the input text to uppercase, but the problem is that if there is more than one character on the key, then you need to make sure that only the first character is "capsulated". I tried a lot of tricks but in the end nothing. text with type CharSequence

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question