Probably the view doesn't have focus.

On Mon, Aug 24, 2009 at 6:21 AM, SIDIBE Ali-Broma <[email protected]>wrote:

>
>
> Hello
>
> I search to to listen a some key by the followin code :
>
>
>
>
>        tv.setOnKeyListener(new OnKeyListener() {
>                @Override           public boolean onKey(View v, int
> keyCode,
> KeyEvent event) {
>                        if (KeyEvent.ACTION_UP != event.getAction()) {
>                          //  int color = Color.BLUE;
>                            tv.setText("Ohlalal");
>                            switch (keyCode) {
>                                case KeyEvent.KEYCODE_CALL:
>                                  //  color = Color.MAGENTA;
>                                    tv.setText("kfkkfklffklfglk");
>                                    setContentView(tv);
>                                    break;
>                                case KeyEvent.KEYCODE_ENTER:
>                                  //  color = Color.YELLOW;
>                                    tv.setText("jgfjgjgjg");
>                                    break;
>                                default:tv.setText("poonpoonon"); ;
>                            }
>
>                           // makeDot(dots, dotView, color);
>                            setContentView(tv);
>                       //     tv.invalidate();
>                         //   tv.refreshDrawableState();
>                        }
>
>                        return true;
>                    }
>
>        });
>
>
> But when I press some key ( eg: Enter of the board near the emulato) I
> find nothing
> Who can say me where is the problem
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to