Android ACTION_SHUTDOWN intent not working when my app is closed. It works well when app is in foreground or background. How can achieve the same performance when app is closed?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Check the following in your manifest file
check here: Android ACTION_SHUTDOWN Broadcast not working
According to official doc.
Broadcast Action: Device is shutting down. This is broadcast when the device is being shut down (completely turned off, not sleeping). Once the broadcast is complete, the final shutdown will proceed and all unsaved data lost. Apps will not normally need to handle this, since the foreground activity will be paused as well.
This is a protected intent that can only be sent by the system.
May include the following extras:
EXTRA_SHUTDOWN_USERSPACE_ONLY
a boolean that is set to true if this shutdown is only for userspace processes. If not set, assumed to be false. Constant Value:"android.intent.action.ACTION_SHUTDOWN"