07-06-2011 04:16 AM
i have written a thread which does some background implementations like socket connection, read from bluetooth.etc. Now i want this thread to run every few seconds and it will return a result which is displayed on the UI.
To run the thread for every few seconds, i can use the TimerTask API. But will this work when my application is currently not on foreground, and someother application is used. If not, could someone please tell me what is the alternative.(Something like AsyncTask from Android and a Handler to run every few seconds)
and how would i return the result from the background thread to the UI?
Anything else i need to handle in the process?
Solved! Go to Solution.
07-06-2011 05:34 AM
i really wonder if anybody solve this issue...................
even i am searching for the solution since 1 month ,to work with 2 tasks at a time in blackberry...eventhough we have threads concept in java we are unable to implement in the blackberry....any help appreciated
07-06-2011 05:50 AM
07-06-2011 09:43 AM
07-07-2011 05:19 AM
thanks alot Simon for all the help,
I used the TimerTask api and in it a thread to do the background process.
After every few seconds the background process is executed and returns the data. But everytime i receive data its not getting immediatley displayed on the UI.
How can i display it parallely ?