Hello,
how do i know if done button was clicked ?
You can do this by setting SetOnEditorActionListener
.
editText1.SetOnEditorActionListener(new OnEditorActionListener(editText1));
Then you can implement TextView.IOnEditorActionListener interface, you can detect the done button click by actionId== ImeAction.Done
. As note: Return true if you have consumed the action in the OnEditorAction, else false.
internal class OnEditorActionListener : Java.Lang.Object, TextView.IOnEditorActionListener
{
private EditText editText1;
public OnEditorActionListener(EditText editText1)
{
this.editText1 = editText1;
}
public bool OnEditorAction(TextView v, [GeneratedEnum] ImeAction actionId, KeyEvent e)
{
if( actionId== ImeAction.Done)
{
Console.WriteLine("Done");
}
return false;
}
}
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.