---
title: "Problem in EditText input method action on setting imeActionLabel"  
description: "Problem in EditText input method action on setting imeActionLabel"  
author: "Anonymous User"  
published: 2014-11-06  
updated: 2014-11-07  
canonical: https://www.mindstick.com/forum/2533/problem-in-edittext-input-method-action-on-setting-imeactionlabel  
category: "android"  
tags: ["android edittext"]  
reading_time: 1 minute  

---

# Problem in EditText input method action on setting imeActionLabel

I have an Edittext with imeoptions asactiongo. and I triggered my [event](https://www.mindstick.com/articles/167719/marquee-hire-benefits-of-event-lighting-hire-london) when pressing soft [keyboard](https://www.mindstick.com/forum/23117/android-soft-keyboard-close-hide) enter button.\

```
mModelId.setOnEditorActionListener(new OnEditorActionListener() {        @Override        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            boolean handled = false;           // if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) {            if (actionId == EditorInfo.IME_ACTION_GO) {                 id = mModelId.getText().toString();                System.out.println("Model id in Edittext:-"+ id);                Toast.makeText(getActivity(), "You entered "+id, Toast.LENGTH_LONG).show();                System.out.println("Before Call Volley");                callVolley();                handled = true;            }            return handled;        }    });
```

Everything [works fine](https://answers.mindstick.com/qa/115732/my-software-works-fine-on-windows-10-but-crashes-on-windows-11-why) but when I [add](https://www.mindstick.com/forum/12983/add-address-in-textbox-when-page-is-load-and-if-i-search-address-in-textbox-show-in-map-by-javascript) actionlabel to enter key the event is not firing.mModelId.setImeActionLabel("[Search](https://www.mindstick.com/articles/65368/best-smo-services-company-in-hyderabad-improve-search-rankings) [Model](https://yourviews.mindstick.com/view/81334/america-is-reopening-after-corona-lockdown-but-on-swedish-model)", KeyEvent.KEYCODE_ENTER);. What may be the [problem](https://yourviews.mindstick.com/view/81399/tackling-the-problem-of-unemployment-during-corona-pandemic)?\

## Replies

### Reply by Lillian Martin

try this

declare edittext and OnEditorActionListener() like this

```
mModelId= (EditText) findViewById(R.id.edittext_id);        mModelId.setImeActionLabel("Search Model",KeyEvent.KEYCODE_ENTER);        mModelId.setOnEditorActionListener(new OnEditorActionListener() {        @Override        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {            boolean handled = false;             if (actionId == KeyEvent.KEYCODE_ENTER) {                 id =mModelId.getText().toString();                System.out.println("Model id in Edittext:-"+ id);                Toast.makeText(getActivity(), "You entered "+id,    Toast.LENGTH_LONG).show();                System.out.println("Before Call Volley");                callVolley();                handled = true;            }            return handled;        }    });
```


---

Original Source: https://www.mindstick.com/forum/2533/problem-in-edittext-input-method-action-on-setting-imeactionlabel

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
