本文介绍了Android的 - 4.2.2显示/隐藏系统栏(的Nexus 10)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有问题的Nexus 10 - 4.2.2。我在测试code以下的的Galaxy Tab 10.1与4.0.4,这是工作的罚款:
I got issue with Nexus 10 - 4.2.2. I was testing code below on Galaxy Tab 10.1 with 4.0.4 and it was working fine:
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的系统栏将不会显示后,就躲起来。
But on Nexus 10 system bar won't show after, just hide.
推荐答案
要显示和隐藏系统栏和通知栏上的4.2.2和其他人:
To show and hide the system bar and notification bar on 4.2.2 and others:
隐藏:
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)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!