Android - 活动堆栈,将当前活动置于前面并禁用后退键
我有一个具有以下活动的应用程序;
登录->首页区->交互记录器(触摸屏来记录交互)
虽然此交互记录器处于活动状态,但我希望能够允许用户通过后退键或主页键退出应用程序,并且仍然能够返回到该交互记录器。但是,如果交互记录器完成(在计时器上管理),则用户将进入登录活动
另外,我是否应该在交互记录器中覆盖后退键,因为我不希望用户在记录期间破坏活动
预先感谢,
安迪
I have an application which has the following activities;
Login -> Home Area -> Interaction recorder (touch screen to record interaction)
Whilst this interaction recorder is active i want to be able to allow the user to exit the app through either the back key or home key and still be able to get back to that interaction recorder. However if the interaction recorder is finished (managed on a timer) then the user is taken to the login activity
Also, should I override the back key whilst in the interaction recorder because I do not wish for the user to destroy the activity during its recording
thanks in advance,
Andy
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要禁用设备的所有按键并需要处理返回键。重写以下方法,但请记住,您无法控制
home 键
和end call key
的行为。在从一个 Activity 移动到另一个 Activity 时,要实现应用程序退出要求,请完成如果您需要回来,请返回上一篇并开始...
you need to disable all the keys of device and need to handle back key. Override the below method but remember you can not control the behaviour of
home key
andend call key
..to achieve your app exit requirement while moving from one activity to another finish the previous one and start it if you need to come back ...