[TIMOB-15180] Android: Implement an event "taskremoved" when Service.onTaskRemoved() is called
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2013-09-17T23:39:22.000+0000 |
Affected Version/s | Release 3.1.2 |
Fix Version/s | 2013 Sprint 19, 2013 Sprint 19 API, Release 3.2.0 |
Components | Android |
Labels | module_android, qe-testadded |
Reporter | Ping Wang |
Assignee | Ping Wang |
Created | 2013-09-13T22:03:17.000+0000 |
Updated | 2014-06-19T12:42:52.000+0000 |
Description
Swiping app away from the recent apps list will kill any background or empty processes of the application but it won't stop the running services or remove the notifications from the status bar. See the discussion here:
http://www.howtogeek.com/169549/what-exactly-happens-when-you-swipe-an-android-app-from-the-recent-apps-list/
http://lifehacker.com/what-happens-when-you-remove-an-app-from-androids-mult-1179868228
In order to get notified when the app is swiped away, we need to implement a new event which is fired from [Service.onTaskRemoved()](http://developer.android.com/reference/android/app/Service.html#onTaskRemoved(android.content.Intent)).
PR: https://github.com/appcelerator/titanium_mobile/pull/4687 For FR: 1. Run the test case below on 4.0+ devices and should see the log "Hello World! I am a Service. I have this to say: Titanium rocks!". 2. Click the HOME button and then swipe the app away from the recent app list. Should see the log "**************************** taskremoved fired". Test case: ----------------------- app.js -----------------------
----------------------- service.js -----------------------
----------------------- tiapp.xml -----------------------
Verified the fix with: Appc-Studio: 3.2.0.201310181700 Sdk:3.2.0.v20131021142445 alloy:1.2.2 npm:1.3.2 titanium:3.2.0 titanium-code-processor:1.0.3 Device:Google Nexus 7(v4.2.1), iPOD Touch1(v7.0) Xcode: 5 Taskremoved() working well on android.