-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Service(timer task) not started when the application close #23
Comments
Same issue, i notice that if i close the app the service stop logging, in the running apps in the device i see the app but with 0 process and 1 service Phonegap 4.2.0-0.23.0 |
Does the service ever start? The service should show in logcat as "MyService". I'm not seeing it in the above logcat - this maybe because the service hasn't started or you've filtered out of the logcat. If in doubt, post a full logcat of start, run, stop (full lifecycle) |
Service is started ..timer task run every time interval when the app is open....if i close the app then timer task never run(for checking used the notificaton in doWork()) ....the above one is the stacktrace in my app..if you want i will send my entire application.. |
In your logcat, you should have various logs Tag'ed as "Background Service" You should see the Background Service giving messages like "Timer task starting work" & "Timer task completing work". This the code that wraps the doWork. Are you seeing these message in your logcat when the app is open? Are you seeing these message in your logcat when the app is closed? (If in doubt, post the whole logcat) |
Logcat(When starting the service) D/BackgroundServicePluginLogic(16652): Start of Execute I/BackgroundService(16652): Syncing result Timer task start work(when the app is open) I/BackgroundService(16652): Timer task starting work I/BackgroundService(16652): Syncing result when close the app D/BackgroundServicePluginLogic(16652): On Destroy Start |
The following code resolved the issue...Your plugin works well the problem is android kitkat version.. Thank you so much... // this is for kitkat (nexus 7 tablet) service issue |
In my cordova application enable the timer when the app is open the service run without any problem..when close the app the service never run.
cordova version 4.2 (and also tested in 3.3) and android version 4.4.2(nexus 7 device).
manifest is like:
but viewing in apps -> running apps it shows 0 process and 1 service.
Here is the logcat when close the app:
D/CordovaActivity(4246): CordovaActivity.onDestroy()
D/CordovaWebView(4246): >>> loadUrlNow()
D/BackgroundServicePluginLogic(4246): On Destroy Start
D/BackgroundServicePluginLogic(4246): Checking for services
D/BackgroundServicePluginLogic(4246): Found services
D/BackgroundServicePluginLogic(4246): Calling service.close()
D/ServiceDetails(4246): Close called
D/ServiceDetails(4246): Listener deregistering
D/ServiceDetails(4246): Listener closing
D/BackgroundServicePlugin(4246): Starting closeListener
D/BackgroundServicePlugin(4246): Sending update
D/BackgroundServicePlugin(4246): Start of transformResult
D/BackgroundServicePlugin(4246): Status is OK
D/BackgroundServicePlugin(4246): We have data
D/BackgroundServicePlugin(4246): End of transformResult
D/BackgroundServicePlugin(4246): Sent update
D/BackgroundServicePlugin(4246): Finished closeListener
D/ServiceDetails(4246): Listener closed
D/ServiceDetails(4246): Listener deregistered
D/ServiceDetails(4246): Removing ServiceListener
D/BackgroundService(4246): Listener removed
D/ServiceDetails(4246): Removing ServiceConnection
D/ServiceDetails(4246): Close finished
D/BackgroundServicePluginLogic(4246): On Destroy Finish
The text was updated successfully, but these errors were encountered: