GO button on textarea mobile devices

I want to add a GO button when users type text in a text box on my site. In the <input> element, this button appears when the input field is on the form, and there is a submit button (at least for my version of the android, which is), however I cannot make it appear in the text field.

What properties or elements do I need to configure so that I have a "GO" or "SUBMIT" button on the virtual keyboards of mobile devices when I enter a text field?

And a little visually, I'm talking about this guy in blue

enter image description here

+5
source share
1 answer

Add below lines to your EditText, the Go button will appear on your keyboard

 <EditText android:singleLine="true" android:imeOptions="actionGo"/> 

Use the code below to listen to the GO button

 editText.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if(actionId== EditorInfo.IME_ACTION_GO){ //perfrom your action } return false; } }); 

Hope this works for you.

-2
source

Source: https://habr.com/ru/post/1214164/


All Articles