"Menu" button disabled when I override onKeyDown

by Mark Murphy » Mon, 19 May 2008 16:32:23 GMT

Sponsored Links
 > I am overriding onKeyDown in my activity, and calling

I'm not sure this is the problem, but you probably should return the value
of super.onKeyDown(keyCode,event); for the cases where you're not handling
the key.

Basically, if you're not handling the key, you want Android to use the
exact same behavior as if you didn't have an onKeyDown() method in the
first place. Right now, though, you're always returning true, which may or
may not be what super.onKeyDown() would return if you weren't overriding

If that doesn't clear up the problem, write back!

Mark Murphy (a Commons Guy)
The Busy Coder's Guide to Android Development -- coming in June 2008!


Other Threads

1. What's the official way to take a picture using the camera?


I know that the Android's sample api has a CameraPreview code, but it
is completely useless. It shows the camera on screen, but has no ways
to actually take a picture.

Is there a complete sample or a code to take a picture? What's the
official way for doing that?

Currently i use this code that worked fine until Froyo appeared:

   private void captureCamera(String s)
      targetPhotoName = s;
      Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
      intent.setType(s.endsWith(".3gp") ? "video/*" : "image/*");
      startActivityForResult(intent, TAKE_PHOTO);

Does not work in Froyo at all.




2. Uploading a zip file to localhost from android

Hi everyone,
Can any one please tel how can i upload the zip file stored in /data/
data/pckg_name/files/zip_file.zip to my local host(xampp web server)


3. need feedback on some alternative app stores

4. Are Amazon serious with the app store?

5. app2sd di froyo

6. Dynamic for generation in android and Multiple screen isse

7. Document for init.rc and android services