简体   繁体   English

在非rooted 4.0+ android平板电脑上以编程方式禁用(不隐藏)系统UI栏?

[英]Disable (not hide) system UI bar programmatically on non-rooted 4.0+ android tablet?

In my app, there is a activity where it is important that the system UI buttons (home, back, etc.) are not pressed, though it is ok if they are still visible. 在我的应用程序中,有一项活动很重要,那就是不要按下系统UI按钮(主页,后退等),尽管可以看到它们也可以。 I have heard that there might be a way to achieve this, at least in 4.0 (I'm using 4.2). 我听说可能至少有一种方法可以实现此目的,至少在4.0中(我使用的是4.2)。

A way to quickly and automatically return to the app if the buttons are pressed is also a correct answer, but seems less plausible. 如果按下按钮可以快速自动返回到应用程序,这也是正确的答案,但似乎不太可行。 Thanks. 谢谢。

This is possible to override the home button by making your activity as home activity ie -- category android:name="android.intent.category.HOME" 可以通过将您的活动设置为家庭活动来覆盖“主页”按钮,即-category android:name =“ android.intent.category.HOME”

but in this case android give user option to choose the app on launcher dialog where if user choose your application and click always, he will not be able to go to homescreen until you specifically provide a exit button oinside your app and reset it which you should definately do. 但是在这种情况下,android为用户提供了在启动器对话框中选择应用程序的选项,如果用户选择您的应用程序并始终单击,他将无法进入主屏幕,除非您在应用程序旁边专门提供了退出按钮并将其重置,一定要做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM