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
view.

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.

Thanks,
MB

--



Other Threads

1. WiFi Kantor

Hew hew hew hew........ @toilet



|| Jus ||
~ envoyer  l'aide de tlphone google_one~
 CSDI V4 REMIX X10 

-- 
"Indonesian Android Community [id-android]" 

2. Update WTS: Nexus One + N900 bnib

Nexus seken sold to mr. H di jakarta. 
Thanks

@yopiesuryadi
www.jeruknipis.com/forum

-- 
"Indonesian Android Community [id-android]" 

3. Closed WTGive: Matrix Broadband 0814

4. setContentView() twice on an activity?

5. Overcharge protector pada spica

6. Password file

7. Mod: Mari Gunakan Nama Asli