BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 09-26-2008, 04:38 AM   #1
Mikaël Donini
Knows Where the Search Button Is
 
Join Date: Sep 2008
Model: 7100T
PIN: N/A
Carrier: none
Posts: 32
Default (JAVA) add menu items to menu : items are lost if blackberry simulator is restarted

Please Login to Remove!

Hi All,

I have written a JAVA application that adds menu items to the calendar menu.

In the BlackBerry 8120 simulator, when I run this application, my menus items are correctly added in the calendar menu.

But if I stop the simulator (File\Exit) then restart it, the added calendar items have disappeared. I must run again the application (which is still present in the simulator) to add the menu items again.

Do you know what is wrong? How can I do to make these menu items persistent between 2 BlackBerries simulators restarts? Is it a normal simulator behaviour?


Here is my code:

Code:
import net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository;
import net.rim.device.api.system.Application;

public final class TheApp extends Application { 
	public static void main(String[] args) 
	{
		new TheApp().enterEventDispatcher();
		System.exit(0);
	} 

	public TheApp() 
	{ 
		super();
		
		ApplicationMenuItemRepository repository = ApplicationMenuItemRepository.getInstance();
		
		// OpenConfMenuItem and EditConfParamsMenuItem are the classes that inherits ApplicationMenuItem
		OpenConfMenuItem ami1 = new OpenConfMenuItem();
		EditConfParamsMenuItem ami2 = new EditConfParamsMenuItem();
		
		repository.addMenuItem(ApplicationMenuItemRepository.MENUITEM_CALENDAR,	ami1);
		repository.addMenuItem(ApplicationMenuItemRepository.MENUITEM_CALENDAR,	ami2);
	}
}
Mikaël Donini, Arkadin France

Last edited by Mikaël Donini; 09-26-2008 at 04:52 AM..
Offline  
Old 09-26-2008, 08:51 AM   #2
Ivanov
Talking BlackBerry Encyclopedia
 
Join Date: Apr 2008
Location: Germany, BW
Model: -
PIN: N/A
Carrier: -
Posts: 310
Default

you have to make your application starting during the startup of the device.

right-click on project, Application, check auto-run on startup
__________________
Blessed is the end user who expects nothing, for he/she will not be disappointed. (Franklin's Rule)
Offline  
Closed Thread



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$317.00



Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP  picture

Mitsubishi FR-A540-0.75K-NA AC DRIVE INVERTER 1 HP 380-480 VAC 50/60 HZ 4.1 AMP

$649.99



1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Drive Main Board #CZ picture

1PC USED A54MA30B Mitsubishi F500/A500/A540 Series 30-37KW Drive Main Board #CZ

$255.00



A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board picture

A54MA55B and BC186A413G52 frequency converters A500/F540 series 55KW drive board

$350.00



Radiomatic Flo-One Beta Radio-Chromatography Detector A-500 Model A525 [E2FL] picture

Radiomatic Flo-One Beta Radio-Chromatography Detector A-500 Model A525 [E2FL]

$245.00



1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ picture

1PC USED A54MA55B BC186A413G52 Mitsubishi A500/F540 Series 55KW Drive Board #CZ

$300.00







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