android - requestWindowFeature(Window.FEATURE_NO_TITLE) exception

后端 未结 5 530
后悔当初
后悔当初 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:39

    So:

    @Override
    protected void onCreate(
        final Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
    
        // Make this activity, full screen
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    
        // Hide the Title bar of this activity screen
        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    
        setContentView(R.layout.main);
    
        // MORE INIT STUFF HERE...
        //img = (ImageView) findViewById(R.id.imgRandom);
        //btnRandom = (Button) findViewById(R.id.btnRandom);
    }
    

提交回复
热议问题