android - requestWindowFeature(Window.FEATURE_NO_TITLE) exception

后端 未结 5 526
后悔当初
后悔当初 2020-12-21 18:14

I am setting a specific activity full screen when the use hits a START button.

In this case the showStopButton() is called .

It\'s running fine

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-21 18:54

    Try this one......

    public class MainActivity extends Activity {
    
        Context context;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
    
            context = this;
    
            requestWindowFeature(Window.FEATURE_NO_TITLE);
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);
    
            setContentView(R.layout.activity_main);
        }
    }
    

提交回复
热议问题