START ボタンを押したときに特定のアクティビティを全画面表示するように設定しています。
この場合、showStopButton()
は と呼ばれます。
順調です。しかし、私が挿入した場合
requestWindowFeature(Window.FEATURE_NO_TITLE);
その後、クラッシュし、コンテンツを追加する前に呼び出す必要があると述べています。
NO_TITLE
wを設定するにはどうすればいいですFULL_SCREEN
か??
private void showStopButton(){
// requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().findViewById(android.R.id.content).requestLayout();
// handle element visibility
((Button)findViewById(R.id.stopButton)).setEnabled(false);
((Button)findViewById(R.id.startButton)).setVisibility(View.GONE);
((Button)findViewById(R.id.stopButton)).setVisibility(View.VISIBLE);
((SeekBar)findViewById(R.id.seekBar1)).setVisibility(View.VISIBLE);
((Button)findViewById(R.id.resetButton)).setVisibility(View.GONE);
((Button)findViewById(R.id.saveButton)).setVisibility(View.GONE);
}
STARTボタンが再表示されたときは逆のプロセスがあり、正常に動作しています。この場合、フルスクリーンモードを削除します
private void showStartButton(){
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().findViewById(android.R.id.content).requestLayout();
....
}