How to change Input Method Action Button in Android? Last Updated : 14 Jul, 2021 Comments Improve Suggest changes Like Article Like Report In this article, IME(Input Method Action) Option is changed in android according to our requirement. Input Method Action Button is located in the bottom right corner of the soft keyboard. By default, the system uses this button for either a Next or Done action unless your text field allows multi-line text, in which case the action button is a carriage return. However, you can specify additional actions that might be more appropriate for your text fields, such as Go, Send, Previous, None, etc. The IME option for Next and Done are shown below. Action NextAction DoneAdd the following code in activity_main.xml file.In this file we specify IME option to the EditText according to the need. Here an imageview and two edittexts are added and and IME option is specified for actionDone. activity_main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity"> <ImageView android:layout_gravity="center" android:layout_marginTop="50dp" android:layout_width="200dp" android:layout_height="200dp" android:src="@drawable/gfg" /> <EditText android:layout_marginTop="50dp" android:layout_marginStart="10dp" android:layout_marginEnd="10dp" android:id="@+id/editText1" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Username" android:paddingBottom="20dp" android:inputType="text" /> <EditText android:paddingTop="20dp" android:layout_margin="10dp" android:id="@+id/editText2" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="Password" android:imeOptions="actionDone" android:inputType="textPassword" /> </LinearLayout> Now add the following code in MainActivity.java file. In this file we add listener to our EditText which will correspond to our action accordingly. Here we override onEditorAction method and show toast for ACTION DONE and ACTION NEXT IME options. MainActivity.java package org.geeksforgeeks.imeoption; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.view.KeyEvent; import android.view.inputmethod.EditorInfo; import android.widget.EditText; import android.widget.TextView; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); EditText login = findViewById(R.id.editText1); EditText password = findViewById(R.id.editText2); login.setOnEditorActionListener(actionListener); password.setOnEditorActionListener(actionListener); } // whenever the user clicks on IME button this listener will // get invoked automatically. private TextView.OnEditorActionListener actionListener = new TextView.OnEditorActionListener() { @Override public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { switch (actionId) { case EditorInfo.IME_ACTION_NEXT: Toast.makeText(MainActivity.this, "Next", Toast.LENGTH_SHORT) .show(); break; case EditorInfo.IME_ACTION_DONE: Toast.makeText(MainActivity.this, "Login", Toast.LENGTH_SHORT) .show(); break; } return false; } }; } Comment More infoAdvertise with us Next Article How to change Input Method Action Button in Android? M madhavmaheshwarimm20 Follow Improve Article Tags : Java Android DSA Android-Misc Practice Tags : Java Similar Reads How to Handle IME Options on Action Button Click in Android? We often observe that a keyboard pops up when we try to enter input in editable fields. These inputs are generally accepted by the application for performing specific functions and display desired results. One of the most common editable fields, that we can see in most of the applications in daily u 3 min read How to Change Colors of a Floating Action Button in Android? Android applications use the Floating Action Button for prompting the user to perform some important action within the android application. Floating Action Buttons in android applications are used to perform some important functionality within android applications. Many times in the android applicat 3 min read How to Add Image on Floating Action Button in Android? A floating action button (FAB) is a user interface element in the mobile application that is typically circular and floats above the main content. It usually has a prominent color and icon, and it is used to provide quick access to the most commonly used action within the app. Step-by-Step Implement 1 min read How to Set Buttons Inside an Alert Dialog in Android? In this article, we are going to see how can we set two buttons inside an Alert Dialog. For example, we can see when an alert dialog is pop up then their two types of buttons available one is the Ok or Positive Button another one is Cancel or Negative Button. Alert dialogs are most frequently used i 4 min read How to Change Button Font in Android? A Button in Android is a UI element provided to a user to click to perform a certain action. A text can be set inside the button to name it. However, this text can be seen in a particular font only which is set by default. So in this article, we will show you how you could change the Button text fon 2 min read Like