BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-10-2007, 07:45 PM   #1 (permalink)
New Member
 
Join Date: Dec 2007
Model: 7100
PIN: N/A
Carrier: Sprint
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Auto-Run on Startup

Please Login to Remove!

Hello All,

I am a total nub to JDE programming. I am trying to develop a Consent Notice that will pop up every time a user turns on their handheld. Nothing elaborate just a something like a Hello World program that pops up after start. This is what I have so far.

Code:
package com;
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;

/*
 * BlackBerry applications that provide a user interface
 * must extend UiApplication.
 */
public class Notice extends UiApplication
{
        public static void main(String[] args)
        {
                //create a new instance of the application
                //and start the application on the event thread
                Notice theApp = new Notice();
                theApp.enterEventDispatcher();
        }

        public Notice()
        {
                //display a new screen
                pushScreen(new NoticeScreen());
        }
}

//create a new screen that extends MainScreen, which provides
//default standard behavior for BlackBerry applications
final class NoticeScreen extends MainScreen
{
        public NoticeScreen()
        {
                //invoke the MainScreen constructor
                super();

                //add a title to the screen
                LabelField title = new LabelField("Consent Notice",
                       LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
                setTitle(title);

                //add the text I've read & consent to terms in IS user agreement to the screen
                add(new RichTextField("I've read & consent to terms in IS user agreement."));
        }

        //override the onClose() method to display a dialog box to the user
        //with "Thank You!" when the application is closed
        public boolean onClose()
        {
            Dialog.alert("Thank You!");
            System.exit(0);
            return true;
        }
}
I have the project set to Auto-Run on Startup. I can see the app starting in the debugger, just can’t get it to pop up in the foreground like I need it to. Any ideas on how I can get my app to pop up on startup?
Offline  
Old 12-11-2007, 12:11 AM   #2 (permalink)
Talking BlackBerry Encyclopedia
 
richard.puckett's Avatar
 
Join Date: Oct 2007
Location: Seattle, WA
Model: 9020
PIN: N/A
Carrier: T-Mobile
Posts: 212
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

This might help
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

(8) MSA 10083913 INTERNAL Li-Poly BATTERY - ALTAIR 4/ 4X MULTI-GAS DETECTOR *K12
$43.99
(8) MSA 10083913 INTERNAL Li-Poly BATTERY - ALTAIR 4/ 4X MULTI-GAS DETECTOR *K12 pictureMSA Altair 4 gas Monitor Detector H2S,LEL,CO,O2
$265.0
MSA Altair 4 gas Monitor Detector H2S,LEL,CO,O2 pictureMSA 10089321 Calibration Assembly with Cap, Tube and Connector for Altair 4 Gas
$27.67
MSA 10089321 Calibration Assembly with Cap, Tube and Connector for Altair 4 Gas  pictureMSA Altair 4x Multi Gas 10107602 Detector O2 CO H2S LEL Warranty Calibrated
$595.0
MSA Altair 4x Multi Gas 10107602 Detector O2 CO H2S LEL Warranty Calibrated picturePROFESSIONAL TOOLS: ALTAIR 4 – FOUR GAS MULTIGAS DETECTOR – MSA
$355.0
PROFESSIONAL TOOLS: ALTAIR 4 – FOUR GAS MULTIGAS DETECTOR – MSA    picture






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