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
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified
Accepted Solution

Using custom dialog as the main GUI for background app

I’ve create a background application by extending UiApplication then calling                                  UiApplication.getUiApplication().requestBackground(); to set it to run in the background.

 

Since my application only requires periodically user input and a couple of edit fields I’d like to use a custom dialog screen as the main GUI for may background application.

 

I searched but did not find anything similar. Am I on the right track of extending UiApplication? The proble i'm seeing is that the screen goes white when my dialog is in the foreground.

 

Tony

Developer
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: Using custom dialog as the main GUI for background app

When is the whitesvreen is apprearing, is it when you call requestForeground method?

 

 


Use Search. "Accept Solution" If the problem is resolved.
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Re: Using custom dialog as the main GUI for background app

I did a test to see how using the custom dialog as the main UI using this method.  The idea is to present the dialog when user click on background app icon.Then user doen with interfacing with dialog it will close andthe app is in background again.

 

 

class BackgroundApp extends UiApplication { public static void main(String[] args) { BackgroundApp theApp = new DialogApp(); theApp.enterEventDispatcher(); } public BackgroundApp() { UiApplication.getUiApplication().requestBackground(); //Create an instance of and display the custom dialog. CustomDialog myGUIDialog = new CustomDialog(); myGUIDialog.show(); } }

 


 

Highlighted
Developer
Posts: 17,019
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Using custom dialog as the main GUI for background app

UiApplications always have a white screen. extend Application instead and use the Ui class to display the dialog globally.
----------------------------------------------------------
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
Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Re: Using custom dialog as the main GUI for background app

Thanks simon. i will try this and post solve if it works for me.

 

Tony

Developer
Posts: 107
Registered: ‎08-08-2008
My Device: Not Specified

Re: Using custom dialog as the main GUI for background app

That worked for my case. This is what i did as simon suggested.

class BackgroundApp extends Application { public static void main(String[] args) { BackgroundApp theApp = new BackgroundApp(); theApp.enterEventDispatcher(); } public BackgroundApp() { //Create an instance of and display the custom dialog. CustomDialog myGUIDialog = new CustomDialog(); UiEngine ui = Ui.getUiEngine(); ui.queueStatus(myGUIDialog, 1, false); } }

 

Thanks guys...