【发布时间】:2016-12-08 02:02:18
【问题描述】:
[导航栏][1]
我正在编写一个应用程序并在 onCreate()-Function 中禁用导航栏:
在 Android 4.4 中:
Runtime.getRuntime().exec("/system/xbin/su -c service call activity 42 s16 com.android.systemui");
在 Android 5 中:
Runtime.getRuntime().exec("/system/xbin/su -c am stopservice -n com.android.systemui/.SystemUIService");
Runtime.getRuntime().exec("pm disable com.android.systemui");
Runtime.getRuntime().exec("kill 'processID of systemui'");
这很好用。 但两者都不适用于 Android 6。
之后……
Runtime.getRuntime().exec("/system/xbin/su -c service call activity 42 s16 com.android.systemui");
...SystemUI/Navigationbar 被禁用,Touch 也被禁用。
然后……
Runtime.getRuntime().exec("/system/xbin/su -c am stopservice -n com.android.systemui/.SystemUIService");
Runtime.getRuntime().exec("pm disable com.android.systemui");
Runtime.getRuntime().exec("kill 'processID of systemui'");
... SystemUI/Navigation 被禁用 3 秒后再次出现。
有人可以帮忙吗?
【问题讨论】:
-
您以编程方式将逻辑设置为 3 秒,有关详细信息,请参阅此链接:-developer.android.com/training/system-ui/immersive.html
-
这对我有用(android 6.0.1)stackoverflow.com/a/41856988/3547724
标签: android user-interface android-6.0-marshmallow