multithreading - Android Connect to Running Thread -


i creating app has uithread , background thread. background thread being used timer - every second sends message uithread update ui. when user exits app hitting backbutton, thread continues run. want happen since user may want open app while timer continues count down.

my question when user comes app. want connect background thread running display current state of app - how time left, etc. question how hook in thread still running in background. have tried using thread , asynctask, same issue occurs.

thanks can provide.

your thread still turning sheer chance - application in fact still running , thread shut down when android decides needs resources.

however want well-provided in android - need implement service have process runs in background separately application. can have service start @ boot , run whether or not application started.

this http://developer.android.com/reference/android/app/service.html has of need know. communicate between service , foreground activity you'll need bind service interface, fortunately done.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -