KeyListener not working as expected

by MB » Wed, 14 Apr 2010 03:03:50 GMT

Sponsored Links
 Hello All,
I am trying to implement a basic program.

I have a EditText view, and want to set a KeyListener to it.

Here is the code below.

myText.setOnKeyListener(new View.OnKeyListener() {
           public boolean onKey(View view,int keyCode,KeyEvent ke)
                        Log.d(TAG,nto on key;
               return true;

As it is returning true, the onKey method is called for all keys from
keyboard on screen, but the typed text does not appear on the EditText

If I return false, the onKey method is called for only meta keys like
Backspace (keyboard on screen),and the typed text does appear on the
EditText view.

I want to typed text on the EditText view, and work for all keys from
keyboard on screen(default Qwerty keyboard).

Where am I making mistake.

Could anyone pls let me know.



Other Threads

1. GTE Presents "GOOGLE ANDROID Application Development" Training at BANGALORE

Dear Sir/Madam,

"Greetings from G.T.Enterprises"

We are Happy and Proud to Announce our First "Google Android" Training
in Bangalore.

Android Training Course is a hands-on guide to designing and building
mobile applications using Google's Android open-source platform. The
course explains what Android is and how it compares to other mobile
environments, the setup of the Android Eclipse-based development
tools, the Android SDK, all essential features, as well as the
advanced capabilities and APIs such as background services,
accelerometers, graphics, and GPS.

This complete hands-on course encourages students to learn by building
increasingly more sophisticated and meaningful mobile applications for
Android phones.

Objective Of the Course :
Upon completion of this course, you will be able to:

    * Build your own Android apps
    * Explain the differences between Android and other mobile
development environments
    * Understand how Androidapplications work, their life cycle,
manifest, Intents, and using external resources
    * Design and develop useful Android applications with compelling
user interfaces by using, extending, and creating your own layouts and
Views and using Menus.
    * Take advantage of Android's APIs for data storage, retrieval,
user preferences, files, databases, and content providers
    * Tap into location-based services, geocoder, compass sensors, and
create rich map-based applications
    * Utilize the power of background services, threads, and
    * Use Android's communication APIs for SMS, telephony, network
management, and internet resources (HTTP).
    * Secure, tune, package, and deploy Android applications

Please find the Android Application Development Course details as
Furnished below :
Sl No
        Name of the Course      Android Application Development
        Course Duration         5 [Five] Days
        Training Dates  Open Enrollment: 12th [Tue] - 16th[Sat] April' 2011
        Location        Bangalore
The course involves  Classroom session and Hands on Work

Target Audience:
This training is designed for programmer with sound knowledge of any
Objective Oriented Language like C++, Java or knowledge in any open
source platform who want to kick start their careers in mobile
application development.

Our Value Additions as furnished below..
1) Quality Training from Trainers.
2) Official Manuals.
3) Course Completion Certificate.

To block your seat for training to "ATTRACTIVE PRICE".

Let us know your thoughts on the same.

Contact : Bharath R, +91 96 11 42 32 32


2. Bluetooth


I am interested in building an application with bluetooth support. I
read that the new android SDK supports bluetooth, but I can't find the

It is possible to work with the bluetooth with the latest SDK? Or I
need to do something else, or it is just not possible?



3. Screen captures of web pages

4. Dialog box without title

5. JSONObject optString output

6. XmlPullParser in a Thread returns nothing every other run. Why?

7. smooth videos play