BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 03-19-2005, 08:46 PM   #1
thesolutioncafe
New Member
 
Join Date: Mar 2005
Posts: 2
Default Problem Running System Wide App

Please Login to Remove!

I'm trying to create a system wide application. I've got the menu option to appear on most menus but when I try to execute the application the program throws an exception... I'm compiling and running this app as a CLDC application that starts at system startup. Any ideas?

package com.thesolutioncafe.blackberry.test;

import net.rim.device.api.ui.*;
import net.rim.device.api.system.*;
import net.rim.device.api.ui.component.Dialog;
import net.rim.blackberry.api.menuitem.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;

public class BBInit extends Application
{
private static long ID = 0xe1e5ac072dc45f40L;

public static void main(String[] args)
{
BBInit theApp = new BBInit();
theApp.enterEventDispatcher();
}

public BBInit()
{
ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();
amir.addMenuItem(ApplicationMenuItemRepository.MEN UITEM_SYSTEM, new BBMenuItem());
}

private static class BBMenuItem extends ApplicationMenuItem {
BBMenuItem() {
super(20);
}

public String toString() {
return "Test Menu Item";
}

public Object run(Object context) {
System.out.println(context);
new BBUI().enterEventDispatcher();
return null;
}
}

final static class BBUI extends UiApplication
{
public BBUI()
{
pushScreen(new BBUIScreen());
}

}

final static class BBUIScreen extends MainScreen
{
public BBUIScreen()
{
super(DEFAULT_MENU | DEFAULT_CLOSE);
setTitle(new LabelField("BBUIScreen", LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH));
add(new RichTextField("Test"));
}

public boolean onClose()
{
Dialog.alert("BBUIScreen Complete");
System.exit(0);
return true;
}

public boolean keyChar(char key, int status, int time) {
//intercept the ESC key - exit the app on its receipt
boolean retval = false;

switch (key) {
case Characters.ESCAPE:
onClose();
retval = true;
break;
}

return retval;
}
}
}
Offline  
Old 03-20-2005, 09:26 PM   #2
Confach
New Member
 
Join Date: Mar 2005
Location: Shanghai,China
Model: 7520
Carrier: China Mobile
Posts: 12
Default

Please see this link,I believe it will is helpful
http://www.blackberry.com/knowledgec...40904&vernum=0
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


RAM MODULE (COMES WITH WIRING HARDNESS) picture

RAM MODULE (COMES WITH WIRING HARDNESS)

$200.00



37061 - IMPERIAL RAM MODULE -  picture

37061 - IMPERIAL RAM MODULE -

$205.00



Tnt Rescue Equipment Hydraulic Ram R-30   724 picture

Tnt Rescue Equipment Hydraulic Ram R-30 724

$240.00



Double Acting Hollow Ram Cylinder (60 Tons - 2

Double Acting Hollow Ram Cylinder (60 Tons - 2") (YG-6050KS)

$549.00



NCR 7616-1301 NCR 72XRT 15

NCR 7616-1301 NCR 72XRT 15" Retail POS Terminal with i3, 8GB Ram 250GB HD No OS

$239.20



RAM-H4M1-03 -  IGNITION MODULE -  picture

RAM-H4M1-03 - IGNITION MODULE -

$160.00







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