In the edittext layout, add the android:imeOptions . Here you can add various action buttons, such as Go, Search, Send, Next, Done, etc. But to use this EditText must be singleLine Else, there will be an enter button. Therefore also use android:singleLine="true".
So here is your solution
<EditText android:id=//put ur id android:layout_width=//according to need android:layout_height=//accordintoneed android:imeOptions="actionNext" android:singleLine="true"/>
EDIT
to add, I have to add some more for future use or to help others.
You can handle display related actions from your code. for this you need to set setOnEditorActionListener in the Edittext, and when the action is clicked, you can get it on the public method boolean onEditorAction(TextView v, int actionId, KeyEvent event) . and if you donβt process the code yourself, the imeoptions action will perform the default action (usually moving to the next control).
Here is a sample code to handle the action
EditText e = (EditText)findViewById(R.id.editText1); e.setOnEditorActionListener(new OnEditorActionListener() { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { if (actionId == EditorInfo.IME_ACTION_NEXT ) {
stinepike
source share