gpt4 book ai didi

Android - 在 4.2.2 (Nexus 10) 上显示/隐藏系统栏

转载 作者:太空宇宙 更新时间:2023-11-03 11:32:06 24 4
gpt4 key购买 nike

我遇到了 Nexus 10 - 4.2.2 的问题。我在 Galaxy Tab 10.1 和 4.0.4 上测试了下面的代码,它运行良好:

try 
{
Process proc = Runtime.getRuntime().exec(new String[]{"sh","startservice","-n","com.android.systemui/.SystemUIService"});
proc.waitFor();
}
catch (Exception e)
{
e.printStackTrace();
}

try
{
//REQUIRES ROOT
Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 42 s16 com.android.systemui"}); //WAS 79
proc.waitFor();
}
catch(Exception ex)
{
//Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
}

但在 Nexus 10 系统栏之后不会显示,只是隐藏。

最佳答案

在4.2.2及其他系统显示和隐藏系统栏和通知栏:

隐藏:

    try
{
String command;
command = "LD_LIBRARY_PATH=/vendor/lib:/system/lib service call activity 42 s16 com.android.systemui";
Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", command }, envp);
proc.waitFor();
}
catch(Exception ex)
{
Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
}

显示:

    try 
{
String command;
command = "LD_LIBRARY_PATH=/vendor/lib:/system/lib am startservice -n com.android.systemui/.SystemUIService";
Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", command }, envp);
proc.waitFor();
}
catch (Exception e)
{
e.printStackTrace();
}

关于Android - 在 4.2.2 (Nexus 10) 上显示/隐藏系统栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15095998/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com