【问题标题】:Android 6.0 Marshmallow How disable/hide Navigationbar/SystemUIAndroid 6.0 Marshmallow 如何禁用/隐藏 Navigationbar/SystemUI
【发布时间】: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 秒后再次出现。

有人可以帮忙吗?

【问题讨论】:

标签: android user-interface android-6.0-marshmallow


【解决方案1】:

我仍在为这个问题寻找一个方便的答案,但目前我正在使用:

禁用状态栏

Runtime.getRuntime().exec("settings put global device_provisioned 0");

启用状态栏

Runtime.getRuntime().exec("settings put global device_provisioned 1");

这并不完美,但 htat 是第一步。

【讨论】:

  • 您找到解决方案了吗?上述解决方案对我不起作用:(
猜你喜欢
  • 2015-07-24
  • 1970-01-01
  • 2016-07-11
  • 1970-01-01
  • 2014-12-01
  • 1970-01-01
  • 1970-01-01
  • 2016-07-20
  • 2017-07-23
相关资源
最近更新 更多