I have an app that allows you to create Home "shortcuts" to a specific Activity
. It turns out that some of my users will use the app, hit the home key to go do something else, then use one of the shortcuts to jump back to that Activity. Since the app is still in memory it just opens the new Activity
on top of the others and the "Back" key will take them back through the whole history. What I'd like to have happen is if they use a shortcut then to effectively kill the history and have the back key just exit the app. Any suggestions?
相关问题
- 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
Try adding
Intent.FLAG_NEW_TASK
to the Intent.First, set up the taskAffinity in the Manifest to make the
Activity
run as a different "task":then, when building the shortcut, set the
FLAG_ACTIVITY_NEW_TASK
andFLAG_ACTIVITY_CLEAR_TOP
flags. Something like: