[AC-2493] Android service does not run after app close if started in event
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-07-09T21:53:14.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Documentation, Titanium SDK & CLI |
Labels | android, api |
Reporter | John Louderback |
Assignee | Shak Hossain |
Created | 2013-06-14T22:39:38.000+0000 |
Updated | 2016-03-08T07:41:32.000+0000 |
Description
An android service which is started inside an App level event listener stops after the application is closed (For instance, via Recent Apps). This is not experienced when the service is started initially with the App. This can be seen when viewing running services. Normal behavior will show that there is a process and/or service running. When started from an event listener, it show app as cached process with no services or, when closed, as a terminated app. I don't know if this expected behavior or a bug, but there is not mention of this possibility in the API documentation.
(Sorry if I'm filing this bug report incorrect, this is my first time).
I'm so sorry, I was very much mistaken. I didn't see it until now. The difference between the two behaviors I mentioned above are not the result of being in an event listener or not, it's the difference between Ti.Android.createService(intent).start(); and Ti.Android.startService(intent);. I don't see the difference in behavior documented still. Why do these operate so vastly different from each other?
Hello John, The difference between the two is this:
creates the service from an intent AND starts the service in one fell swoop. Whereas
can start a service but ONLY after is has already been created. I hope this can shed some light on your inquiry. Regards, Carter
Hello, We tested this issue with the test code below. We can't reproduce this issue in the latest TiSDK build. Please check my test code and let me know if have any problem.
Test Environment
Windows 7, Titanium SDK 3.2.0 GA Android 4.2.2 Ti CLI 3.2.0Test Code
app.jsnotification.js
tiapp.xml