开发者

Type in EditText with buttons

开发者 https://www.devze.com 2023-02-26 07:15 出处:网络
So I hid the soft keyboard because I only want \"1\" and \"0\" to be the buttons to type with and开发者_运维问答 a delete button. I have two EditText boxes. How do I go about letting the user click on

So I hid the soft keyboard because I only want "1" and "0" to be the buttons to type with and开发者_运维问答 a delete button. I have two EditText boxes. How do I go about letting the user click on the EditBox and be able to have those Buttons only type in that box? and same with the delete. I only need to know how to make it recognize that you have chosen that box. Take whats there and add "0" to the end of the string.

Thanks


If all you are looking for is to get the EditText that is selected, then use the hasFocus() method on each EditText. The method returns a Boolean value depending on whether or not it has focus (has been selected by the user). Then insert your text into the EditText that has focus.

If this does not help, I've done something similar to this before and can offer you a different solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消