BlackBerry Forums Support Community

BlackBerry Forums Support Community (http://www.blackberryforums.com/index.php)
-   Developer Forum (http://www.blackberryforums.com/forumdisplay.php?f=15)
-   -   Run Application in Background (http://www.blackberryforums.com/showthread.php?t=183023)

DD12 03-25-2009 04:29 PM

Run Application in Background
 
Hello Everyone

I have an application with user interface and it implements PhoneListener. I want to run that application in the background and bring in front when user selects from the icon or from swtich tab.

How do I achive this?

Thanks

zechariahs 03-25-2009 06:52 PM

So your class looks like the following?

Code:

public class MyClass extends UiApplication implements PhoneListener
That should be all you need to do what you're describing. Unless I'm missing something...

DD12 03-25-2009 07:03 PM

Thanks for the input zechariahs.

I know how to implement PhoneListener. I want to run the application in the background and bring to front when user selects the icon or from swtich tab.

Thanks

zechariahs 03-25-2009 07:17 PM

Try this How To - Setup an alternate entry point for my application.

Quote:

Alternate Entry Points can be used to launch the user interface (UI) component of the auto-started application when the user selects the icon from the ribbon.

DD12 03-25-2009 07:37 PM

Thanks zechariahs.

I understand what is explained in the document. But, what do I need to do from application getting closed using "Close" menu.

Thanks

zechariahs 03-25-2009 08:23 PM

From a user perspective, I would be pretty ticked if I couldn't close an application if I wanted to. Personally, I would override the onClose() method to prompt the user: "Are you sure you want to close? Yes | No | Cancel."

Also, if you really want to prevent the user from closing the application, override the onClose method to always return false.

DD12 03-25-2009 08:25 PM

Thanks zechariahs.

Thats what I did.

hrbuckley 03-25-2009 10:25 PM

To put an application in the background call Application.requestBackground(), possibly as mentioned in the onClose() method.

pravipravi 06-15-2009 04:35 AM

I too need the same idea, that i have an icon When i am pressing the icon, i need to invoke an sms application which is running background. When i am exiting and later on coming bak , i need to keep the same screen alive , from where i exit.

pravipravi 06-15-2009 04:36 AM

if anyone knows pleas provide a sample code too..
Thanks

Ananthasivan V K 06-16-2009 03:48 AM

Hi pravi

You just need to override the onClose() method for doing that, as mentioned above.


All times are GMT -5. The time now is 01:40 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.