, , , . , , Nav/Action .. Crude, , , .
, .. ,
hideNav() onCreate , showNav() onDestroy, , , , , .
, . getActivity(). Finish(), onDestroy .
. , 42, .
public void hideNav()
{
Log.v(tag, "hideNav");
try
{
Process p;
p = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(p.getOutputStream());
os.writeBytes("service call activity 42 s16 com.android.systemui\n");
os.writeBytes("exit\n");
os.flush();
p.waitFor();
}
catch (Exception e)
{
Log.e(tag, "hideNav " + e.getMessage());
}
}
public void showNav()
{
Log.v(tag, "showNav");
try{
Process p;
p = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(p.getOutputStream());
os.writeBytes("am startservice -n com.android.systemui/.SystemUIService\n");
os.writeBytes("exit\n");
os.flush();
p.waitFor();
}catch (IOException e) {
e.printStackTrace();
Log.e(tag, "showNav " + e.getMessage());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
Log.e(tag, "showNav " + e.getMessage());
}
}