我遇到了 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 系统栏之后不会显示,只是隐藏。