O my acer tablet the return does not get replace by done with the following xml, but does on my other 2 android devices
So I was going to use the return key to exit the keyboard as a bck up,
problem, I figured out how to do the call back when enter key is press, but don’t know how to make the keyboard go away,
code
mUserName=(EditText)findViewById(R.id.viewUserName);
mUserName.setOnEditorActionListener(
new android.widget.TextView.OnEditorActionListener()
{
public boolean onEditorAction(TextView v, int actionId, KeyEvent event)
{
// goes here when enter is press
return false;
}
}
);
In your xml for the edit text, set the imeOptions. Basically just add this line:
This will change the enter button to a “done” button, and dismiss your keyboard when pressed.
-OR-
You can add this inside the code block from above