非表示にする
Activity activity = getActivity(); Window window = activity.getWindow(); if(Build.VERSION.SDK_INT < 30){ window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN); } else{ WindowInsetsController insetsController = window.getDecorView().getWindowInsetsController(); insetsController.hide(WindowInsets.Type.statusBars()); }
表示にする
Activity activity = getActivity(); Window window = activity.getWindow(); if(Build.VERSION.SDK_INT < 30){ window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_VISIBLE); } else{ WindowInsetsController insetsController = window.getDecorView().getWindowInsetsController(); insetsController.show(WindowInsets.Type.statusBars()); }
0 件のコメント :
コメントを投稿