태블릿에서 상태 표시 줄을 숨기거나 표시 할 수있는 버튼을 만들려고합니다.Android : 상태 표시 줄/전원 표시 줄 표시/숨기기
전에서 onCreate에 넣어 한
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
및 버튼 쇼에
:WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags &= ~WindowManager.LayoutParams.FLAG_FULLSCREEN;
getWindow().setAttributes(attrs);
숨기기 :
WindowManager.LayoutParams attrs = getWindow().getAttributes();
attrs.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN;
getWindow().setAttributes(attrs);
어떤 힌트/계약 및 프로모션 추천 자료 비즈니스 디렉토리 리뷰는?
// 내가 여기에이 힌트를 검토 한
편집 : http://android.serverbox.ch/?p=306 이처럼 내 코드를 변경 : 내 버튼을 클릭하면 그래서 방법이 내가 할 수라고
private void hideStatusBar() throws IOException, InterruptedException {
Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 79 s16 com.android.systemui"});
proc.waitFor();
}
private void showStatusBar() throws IOException, InterruptedException {
Process proc = Runtime.getRuntime().exec(new String[]{"am","startservice","-n","com.android.systemui/.SystemUIService"});
proc.waitFor();
}
을 앱이 몇 초를 기다리고 있기 때문에 어떤 일이 일어나고 있는지 확인하십시오. 나는 또한 LockCat을 조사하여 어떤 일이 일어나고 있음을 확인했다.
쇼 : http://pastebin.com/CidTRSTi 숨기기 : http://pastebin.com/iPS6Kgbp
예 http://stackoverflow.com/a/35886019/4395114 –