onCreateOptionsMenu broken?

189 views
Skip to first unread message

Brian O'Dell

unread,
Jul 26, 2011, 4:23:35 PM7/26/11
to phonegap
Hello,

I have an app that uses onCreateOptionsMenu() to create a menu when
the user presses the menu button. This was working fine until I
updated to 1.0.0rc3. Now onCreateOptionsMenu() is never called.
Poking around in the code, I found this commit:

https://github.com/phonegap/phonegap-android/commit/53de070a4122d3adec739650654a6f0a3020ff5e

This commit seems to indicate that you guys intend to prevent
developers from handling the Menu key in Java. Is this right?

Thanks,
Brian

eyal

unread,
Aug 1, 2011, 6:33:08 AM8/1/11
to phon...@googlegroups.com
same problem.

Bryce Curtis

unread,
Aug 1, 2011, 10:16:33 AM8/1/11
to phon...@googlegroups.com
This should still work in 1.0.  You need to override onKeyDown() to return false for menu key in your Java app that extends DroidGap. You also need to implement the menu methods like onCreateOptionsMenu(), etc.

eyal

unread,
Aug 1, 2011, 1:08:45 PM8/1/11
to phon...@googlegroups.com
how to  override onKeyDown() to return false?

eyal

unread,
Aug 2, 2011, 12:57:46 AM8/2/11
to phon...@googlegroups.com
i get an error "The method onKeyDown() of type App must override or implement a supertype method"

on 
@Override
public void onKeyDown()(){
}

eyal

unread,
Aug 2, 2011, 1:41:20 AM8/2/11
to phon...@googlegroups.com
sorry my mistake,

@Override
public boolean onKeyDown(int i,KeyEvent e){
return false;
}

now it's work but just to the first page,
when i go to another page with a link the menu stopped working.

Reply all
Reply to author
Forward
0 new messages