Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4086866
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:46:57+00:00 2026-05-20T18:46:57+00:00

I have 14 edittext boxes that a user can change at will. When the

  • 0

I have 14 edittext boxes that a user can change at will. When the text is changed in one of them, a softpad key press on the ‘enter/next/done’ key should re-run a calculation using the new text. I’ve tried onKey listener but it doesn’t work on the soft keyboard, on;y the hard keypad. I’ve tried a textwatcher like onTextChanged but it reacts and runs the calculation when only a single digit is entered, before the user can input a two or more digit number. So… I hear the onEditorActionListener works on soft keypads to watch for the keypress, but I can’t get the syntax right. Here’s what I have:

In the onCreate method:
myEdittext1.setOnEditorActionListener(this);

…
myEdittext14.setOnEditorActionListener(this);

Then, outside the onCreate method, I have:

@Override
 public boolean onEditorAction(TextView v, int actionId, KeyEvent event)
 {  if (event.getKeyCode() == KeyEvent.FLAG_EDITOR_ACTION)
    {  //do my calcs}
    }
    return(true);
 }

The code gives me the foreced-close business. Any help would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:46:58+00:00Added an answer on May 20, 2026 at 6:46 pm

    KeyEvent can be null. You need to check for this situation in your listener.

    v           The view that was clicked.
    actionId    Identifier of the action. This will be either the identifier you supplied, or EditorInfo.IME_NULL if being called due to the enter key being pressed.
    event       If triggered by an enter key, this is the event; otherwise, this is null.
    

    onEditorAction is the appropriate way to listen for finish and Done soft keyboard actions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UI that has 6 EditText boxes. 3 of those EditText boxes
I have an EditText that shows time. After user clicks the EditText I want
Currently I have an edittext field that when the user presses enter it does
I have a EditText and button aligned to parent's bottom. When I enter text
I have one edittext EditText et1=(EditText)findViewById(R.id.EditText01); when i want to clear edittext i use
i have a EditText in android in which i want the user to enter
I have two EditText and one Button in my Layout. If the two EditText
I have an activity that only has a EditText. I want the soft keyboard
I have a few forms that the user has to fill in and I
Doing some R&D for my company. We are trying to have a listView that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.