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 1072693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:53:49+00:00 2026-05-16T20:53:49+00:00

I defined an EditText-field and I want to be informed when the user edits

  • 0

I defined an EditText-field and I want to be informed when the user edits that fields.
So I thought: simple – I add an OnKeyListener and so I did. But even though the text field gets edited (and even displays the entered/modified text) I don’t get any callback, i.e. the LOG-output doesn’t show up.

    TextView text = new TextView(this);
    text.setText(...);
    ...
    text.setOnKeyListener(new OnKeyListener()
    {                           
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            TextView tv = (TextView)v;
            CharSequence val = tv.getText();
            Log.v(TAG, "value: " + val);
            // ... rest omitted for brevity
        }
    });

Any idea, why that callback is never called?

Michael

PS.: Sigh! Android is really full of oddities! It seems that almost nothing I touched so far worked immediatly as one would expect. And – believe it or not – I have LOTS of experience with GUIs, esp. in Java (AWT, Swing, SWT, you name it…) But Android is a really tough beast!

  • 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-16T20:53:49+00:00Added an answer on May 16, 2026 at 8:53 pm

    Are you using the soft keyboard (ime) to type in the edit text? I believe that the onKeyListener only gets invoked with events from the hardware keyboard. You are better off using the TextWatcher if you can. onKeyListener not working with soft keyboard (Android)

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

Sidebar

Related Questions

I have a database that is being filled by user defined EditTexts. None of
I have an Edit Text that is defined as follows. <EditText android:layout_width=fill_parent android:layout_height=wrap_content android:maxLines=1
I'm trying to define an EditText but this warning is shown: This text field
The question is quite simple. But I want to know where exactly do we
I have an EditText displaying a user defined text label. It displays as blue
I want to add an edit text field to my app when i click
I've got a View defined in an xml file. It contains two Edittext fields
I need to get the EditText that's defined in an xml layout which is
ive defined the following and filled it with elements: vector <vector<double> > my_vector; but
I defined a global variable that is called from other view and it is

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.