08-29-2011 10:13 AM - last edited on 08-29-2011 01:41 PM
Hi,
I'm trying to add a MenuItem to my project:
protected void makeMenu (Menu menu, int instance ) {
super.makeMenu(menu, instance);
menu.add (new MyMenuItem());
}
class MyMenuItem extends MenuItem {
MyMenuItem() {
super(new StringProvider("Menu item text"), 100000, 0);
}
}
but when I click the Menu Button I receive NoClassDefFound
Thanks,
Solved! Go to Solution.
08-29-2011 05:48 PM
Have you stepped through your code to see what is causing the problem?
Are you running on a suitable level of simulator given the OS level you have compiled with?
08-30-2011 01:05 AM
I'm looking for a MenuItem which is suitable for OS 5.0 and above....
08-30-2011 01:14 AM
5.0.0 does not have the MenuItem constructor that takes a StringProvider. That was only introduced in 6.0.0. Which means you are probably compiling for 6.0.0 and running on 5.0.0, which you shouldn't do.
08-30-2011 01:17 AM
Thank you for your reply,
Fix me if I'm wrong:
If I want my app to be compatible with both OS 5.0 & 6.0 I need to check the OS version,
If 5.0
Create a MenuItem with the constructor of OS 5.0 - http://www.blackberry.com/developers/docs/5.0.0api
if 6.0
Create a MenuItem with the constructor of OS 6.0 - http://www.blackberry.com/developers/docs/6.0.0api
???
08-30-2011 01:21 AM