---
title: "How to use “OK” key on softkeyboard (numberPassword keyboard) instead of clicking button?"  
description: "How to use “OK” key on softkeyboard (numberPassword keyboard) instead of clicking button?"  
author: "Anonymous User"  
published: 2015-01-23  
updated: 2015-01-23  
canonical: https://www.mindstick.com/forum/12897/how-to-use-ok-key-on-softkeyboard-numberpassword-keyboard-instead-of-clicking-button  
category: "mobile development"  
tags: ["android", "java"]  
reading_time: 1 minute  

---

# How to use “OK” key on softkeyboard (numberPassword keyboard) instead of clicking button?

I have an EditText which InputType is numberPassword, and a [Button](https://www.mindstick.com/articles/63/how-to-add-button-in-datagridview-in-csharp-dot-net)"ANYNAME". I'd like to use "OK" key on softkeyboard (numeric [keyboard](https://www.mindstick.com/forum/23117/android-soft-keyboard-close-hide)) [instead of](https://www.mindstick.com/articles/330/triggers-in-sql-server) the Button"ANYNAME" to [execute](https://www.mindstick.com/interview/49/how-can-i-execute-a-php-script-using-command-line) a [giving](https://yourviews.mindstick.com/view/80639/regifting-is-far-better-than-giving-away-a-bouquet) [function](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) in my code.

How can I realize that?

## Replies

### Reply by Anonymous User

```
mEditText.setOnEditorActionListener(new TextView.OnEditorActionListener()
{        @Override        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            // call some function            return false;        }    });
```

if you want to change "Done" button title, use:

mEditText.setImeActionLabel("OK", KeyEvent.KEYCODE_ENTER);


---

Original Source: https://www.mindstick.com/forum/12897/how-to-use-ok-key-on-softkeyboard-numberpassword-keyboard-instead-of-clicking-button

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
