Sample code to demonstrate an Android 4.4 bug related to Services. The bug appears to only appear in 4.4.1 and 4.4.2 (perhaps earlier versions, but the reports are unreliable and there's less evidence to back that up). At the time of this writing, two distinct fixes have been submitted to AOSP.
To be used as described in [Bug Watch] Stopping Apps On Android 4.4.2 Can Silently Kill Related Background Services, A Fix Is On The Way
NOTE: This project was built with Android Studio v0.4.6
Steps to replicate the bug:
- Build this project and deploy it to a device running 4.4.1 / 4.4.2
- Run the app
- Tap 'Start'
- Press the Home button
- Enter the multi-tasking screen (however your device supports doing that)
- Swipe away / dismiss this app
Expected result on most versions of Android: The toast messages should continue hitting the screen every few seconds.
Expected result on 4.4.1 and 4.4.2: The toast messages will stop appearing on the screen and never return without intervention.