它有可能使一个蜂窝活动不可关闭? [英] It is possible to make a HoneyComb activity unclosable?

查看:108
本文介绍了它有可能使一个蜂窝活动不可关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个presentation风格的应用程序的蜂窝片。在某一阶段的片剂可以围绕一个房间传递的人进行交互。如果可能的话,我想prevent恶意用户从当前的活动导航了。

I'm developing a presentation style application for HoneyComb Tablets. At one stage the tablet may be passed around a room for people to interact with. If possible I would like to prevent malicious users from navigating away from the current activity.

到目前为止,我已经覆盖了 onBack pressed()来prevent整理活动,但用户仍然可以preSS上的其他按钮状态栏,也可以通过该弹出通知离开应用程序。

So far I have overwritten the onBackPressed() to prevent finishing the activity but users can still press the other buttons on the status bar and also leave the app via notifications that pop up.

任何建议或可能的解决方案?

Any suggestions or possible solutions?

感谢

推荐答案

1 。让您的活动全屏。

2 使用alarmManager从固定时间间隔服务触发您的活动说2or3第二(仅当你的活动是不是前台)。对于这种使用布尔变量和使用共享preference存放。该值将在onReume真假的onPause或的onStop或的onDestroy。然后才开始你的活动,从您的服务,如果布尔变量是假的。现在,如果您的用户将preSS的主页按钮,然后AlaramManager踢重新启动您的activiy。

2 Use an alarmManager to trigger your activity from a service on a regular interval say 2or3 second (only if your activity is not foreground). For this use a boolean variable and store it using sharedPreference. this value will be true in onReume and false in onPause or in onStop or in onDestroy. And then only start your activity from your service if the boolean variable is false. Now if your user will press the Home button then AlaramManager kick start your activiy again.

3 请一个特殊的按钮,完成你的服务和活动,并为取消alarmManager。

3 Make a special button for finishing your service and activity and for cancel the alarmManager.

这篇关于它有可能使一个蜂窝活动不可关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆