BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-14-2009, 02:39 AM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Jun 2009
Model: 7110
PIN: N/A
Carrier: engg.
Posts: 19
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Menu item

Please Login to Remove!

import net.rim.device.api.system.*;
import net.rim.device.api.ui.component.Dialog.*;
import net.rim.blackberry.api.menuitem.*;
import javax.microedition.pim.*;

public final class MenuItem extends Application {
private static long ID = 0x7cab1e23b72a0033L; //hash of com.rim.samples.docs.menuitem

public static void main(String[] args) {
MenuItem app = new MenuItem();
app.enterEventDispatcher();

}

MenuItem() {
ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();
amir.addMenuItem(ApplicationMenuItemRepository.MEN UITEM_ADDRESSBOOK_LIST, new SampleMenuItem());
}

static class SampleMenuItem extends ApplicationMenuItem
{
SampleMenuItem() {
super(20);
}

public String toString() {
return "Give me more!";
}

public Object run(Object context) {

net.rim.device.api.ui.component.Dialog.alert("Hell o, you clikked the give me more menu item");

return null;
}
}
}

Hello
when run this program its show on console
Starting App
App is already running.
Offline  
Old 09-14-2009, 08:24 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Jun 2008
Model: 9000
Carrier: Airtel
Posts: 81
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

just give alternate entry point for menu item using.
ApplicationDescriptor app = ApplicationDescriptor
.currentApplicationDescriptor();
// set the argument so that we know which app we want to have launched
app = new ApplicationDescriptor(app,
new String[] { ARG_LAUNCH_CONTACT_DEMO });

and handle this alternate entry point in main method
__________________
blog.vimviv.com
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Advance RSM-175-S-TP Slimline Ballast for one F96T12 F72T12 F64T12 F60T12 Lamp
$12.0
Advance RSM-175-S-TP Slimline Ballast for one  F96T12  F72T12 F64T12 F60T12 Lamp pictureOsram Sylvania M1000/480-KIT 47655-C Metal Halide Magnetic Ballast Metalarc 480v
$99.95
Osram Sylvania M1000/480-KIT 47655-C Metal Halide Magnetic Ballast Metalarc 480v pictureAdvance VEL-2P32-SC Instant-Start 277-Volt Ballast
$10.0
Advance VEL-2P32-SC Instant-Start 277-Volt Ballast pictureKEYSTONE KTEB-2110-UV-TP-PIC F96T12/HO ELECTRONIC BALLAST 2 LAMP
$30.0
KEYSTONE KTEB-2110-UV-TP-PIC F96T12/HO ELECTRONIC BALLAST 2 LAMP picture3 NEW GE LIGHTING BALLASTS T8 4 OR 3 TUBE 4N 120 OR 277 VOLT
$29.99
3 NEW GE LIGHTING BALLASTS T8 4 OR 3 TUBE 4N 120 OR 277 VOLT  picture






Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.