android - 如何对低于 L 的 Android 版本使用 startLockTask() 方法

标签 android api

我在程序中使用 startLockTask() 但发现它只能用于 Android L。但是我希望我的应用程序在低于 5 的版本中运行。

有什么方法可以获得类似的功能吗?

最佳答案

功能上,没有。固定屏幕的目的是防止用户离开您的应用程序。用户无法查看或点击通知,也无法使用主页按钮离开。

视觉上,你can set the app to full screen, , 和/或 hide notification bar .您也可以hide the soft keys on devices that don't have hardware buttons .但是,人们总是可以将其恢复。

编辑:您也可以 disable the back button.

关于android - 如何对低于 L 的 Android 版本使用 startLockTask() 方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28140790/

相关文章:

android - 如何在android中访问摄像头和麦克风?

android - 使用 Android、App 引擎 + 数据存储存储个人资料图像的最佳方式

python - 更改 taiga-back 默认端口 (8000)

java - 使用 Twitter 身份验证验证用户

api - Youtube iFrame javascript API onYouTubeIframeAPIReady not firing

android - 通过单击Google Play链接检查我的应用是否已下载

android - 从屏幕上删除/隐藏首选项

javascript - HTML5 API 与 HTML5 Javascript API

api - 我应该使用单独的 REST 后端项目和 javascript 重型前端吗?

android - 如何在自定义 "square"TextView 中居中文本