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: 49
Registered: ‎07-16-2008
My Device: Not Specified
Accepted Solution

Bringing an application from background to foreground.

Hi,

I want to push my application in background and if the user again try to open the application it should come to the foreground. I have used "UiApplication.getUiApplication().requestBackground();" to send my application in the background.

If I select the application again it is starting but i need to satisfy some condition before it come to foreground. I have reffered this thread "http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=363" but not finding any method which is going to fire when the application going to come in foreground. Pls give me some idea to solve it.

Thanks.

Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: Bringing an application from background to foreground.

Highlighted
Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: Bringing an application from background to foreground.

You say "i need to satisfy some condition before it come to foreground".

 

Before the UiApplication comes to the foreground, it runs the UiApplication.activate() method.  You can put some checks in this code, and do a UiApplication.requestBackground(), if you are not ready to come to the foreground.  You might want to pop a dialog up for the user to let them know why the app won't come to the foreground.  If so, you should use a method like that in the following KB article:

 

How To - Alert a user from a Background application
Article Number: DB-00407
http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...

 

 

New Developer
Posts: 49
Registered: ‎07-16-2008
My Device: Not Specified

Re: Bringing an application from background to foreground.

Thank you so much for clearing the clouds.   :-)