"Menu" button disabled when I override onKeyDown

by kingkung » Mon, 19 May 2008 16:22:21 GMT

Sponsored Links
 I am overriding onKeyDown in my activity, and calling
super.onKeyDown() on all values except for the "Call" button, which I
implement myself.

The other buttons seem to work, but the Menu fails to load when I hit
the Menu button.  What can I do to get around this?



        public boolean onKeyDown(int keyCode, KeyEvent event)
                switch (keyCode)
                        case 5:
                                //perform call function
                return true;

"Menu" button disabled when I override onKeyDown

by Romain Guy » Mon, 19 May 2008 16:29:58 GMT


Returning true from onKeyDown() means "I handled the key event, ignore
it." You are telling the system to ignore the key event. Your code
should return false by default and true only in case 5 (note you
should use the constatnts instead of hard coded values because the key
codes might change.)

Romain Guy


Sponsored Links

"Menu" button disabled when I override onKeyDown

by kingkung » Mon, 19 May 2008 18:53:10 GMT

 Thanks, that was it.

Somewhat unrelated, but simple, question... how do I get the menu to
look like a list of items instead of the table format that it's
currently using?


Other Threads

1. Download Files via Android Browser an https not possible


I want to try to download some file about the android browser. But
every time I start the download via https the download manager show
only the download with the message "Waiting for data...".
I tried different host, but the problem ist always the same.

I used a Milestone with 2.1 and a Samsung Galaxy 9000 with 2.1

Anybody an idea?


2. vold in froyo

Hi All,
I have few questions about vold which is being used in froyo.

- why in froyo vold is re-written in cpp ? where as the vold in eclair is in
- when i plug in usb cable ,from the kernel log i can figure out the
occurrence of charger interrupt. how does froyo vold handles uevents when we
plug in the usb cable?? and which part of the code does this ?
- On boot,if i disable vold service and enable mountd ,my android boot
breaks. why is this happening in froyo?
- and finally what makes froyo vold so special from mountd and eclair vold?


unsubscribe: android-porting+unsubscr...@googlegroups.com

3. what is the default value of account name and type in contact?

4. Getting a View to redraw when parameters change

5. Error parsing Android SDK on linux

6. A ListView that acts like RadioButtons

7. Audio Record problem (urgent)