Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
Posts: 28
Registered: ‎06-18-2012
My Device: Developer
My Carrier: NA

BlackBerry App: Screen Not Showing Up In Auto Run Mode

I am trying to create a background app which will run at system startup. When I run it manually (from the ribbon), the screen appears but when I run the app after making it a startup app (Auto-run on startup option in descriptor), nothing appears on screen. I am trying the following code;

 

public class AppClass extends UiApplication {

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

 

public AppClass() {
pushScreen(new AppScreen());
}
}


And this is the screen class;

 

public final class AppScreen extends MainScreen {

private LabelField label;

 

public AppScreen() {
setTitle("AppTitle");

 

label = new LabelField();
label.setText("Ready.");

 

add(label);
}
}


I am expecting that its a UI app so its screen should be visible no matter if is auto-run at startup or run manually. If I need to do something to make it work as expected, please guide me about it, I am new to BlackBerry development. I am developing in the following environment;

 

BlackBerry JDE Eclipse Plugin 1.5.0
BlackBerry OS 4.5

Developer
Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: BlackBerry App: Screen Not Showing Up In Auto Run Mode

do you restart the device with a battery pull? a soft off does not trigger a reboot (so no autorun).

after a reboot your app should run, but maybe it is not in the foreground. you can check that using the application switcher.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
New Developer
Posts: 28
Registered: ‎06-18-2012
My Device: Developer
My Carrier: NA

Re: BlackBerry App: Screen Not Showing Up In Auto Run Mode

Simon, thanks for replying.
I have restarted the device by removing the battery as well as by doing a hard shutdown (Alt + Caps + Del). And I've also seen my app in Task Switcher. My problem actually is, the app (screen) is not showing up on the screen as it does when I invoke it manually.
Developer
Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: BlackBerry App: Screen Not Showing Up In Auto Run Mode

you can put a requestForeground in it, that should take care of it (unless another app does that, too, but the system apps don't)
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
New Developer
Posts: 28
Registered: ‎06-18-2012
My Device: Developer
My Carrier: NA

Re: BlackBerry App: Screen Not Showing Up In Auto Run Mode

I'll try that and reply back.