tags:

views:

159

answers:

2

i am trying to make a uiapplication If i click on a button then a background thread must start which should run even when my application is exited how can i do that

I created a background thread but it gets stop when the app exits.

A: 

Create your application as a system module that starts automatically and runs in the background. You can have an alternate entry point that will pass an argument to the main app to start your GUI. When you exit the GUI it won't exit the entire application.

Jonathan
1) i want to start background thread when user clicks on a button of uiapplication.2)I couldn't find alternate entry point when i click blackberry properties --> application3) It contains only CLDC Application,Midlet,LibraryCan u post some code or idea to implement,may be m confused how to begin
SWATI
Do i need to create 2 diff apps-one which extends UiApplication and other which extends Application.But how to link them.Moreover it will generate 2 cod files and i want single cod file.God what to do!!!!
SWATI
Look at the "Alternate Entry Points" tab at the bottom of the App Descriptor.
Jonathan
A: 

Create 2 seperate project - making one dependent on the other if need be.

Then use GlobalEvents and GlobalEventListener to communicate between them when the one is in the foreground and the other in the background

Chris
Chris i will try that tooo but presently am using UiApplication.getUiAppliation.requestBackground();I want to make use of the best method.Am i doing right!!!!!!!!!!!
SWATI
i am able to call a background thread even when my app is not in foreground.but how to close that thread.I also tried Global events for the background app but it didn't works
SWATI