"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?

Thanks,

James

        public boolean onKeyDown(int keyCode, KeyEvent event)
        {
                switch (keyCode)
                {
                        case 5:
                                //perform call function
                                break;
                        default:
                                super.onKeyDown(keyCode,event);
                }
                return true;
        }
--~--~---------~--~----~------------~-------~--~----~



"Menu" button disabled when I override onKeyDown

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


 Hi,

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
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~


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. Greystripe experiences?

Hi all

Is anyone using Greystrip for ads within their apps?  Care to share
experiences?

In particular:

1. Any hassles getting payments from them?

2. eCPM comparisons with other ad networks?

Many thanks ...

-- 

2. is .pvr textures supported by 2.2 devices? how do i load them?

hello everyone,

i'm porting an iphone opengl project to android. and have some
questions about pvr texture maps.

i have two kinds of texture maps png and pvr. for pngs i use Bitmap to
load them, which worked fine.

but pvr texture maps, i have no idea how to load them with Android

can somebody give me a hint.

-- 

3. How to configure SDK emulator to start with english instead of japanese?

4. Switching Tab Activities from Sub Activities.

5. How to read pdf file into my customize android app

6. Is it possible to determine a input method in application

7. Visit Installed App Details Page on Android 2.2