问题
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.
回答1:
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.
回答2:
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
来源:https://stackoverflow.com/questions/2920839/how-can-i-call-background-application-from-ui-applicationblackberry