有以下几种情况:
1.
setContentView(R.layout.activity_list); requestWindowFeature(Window.FEATURE_NO_TITLE);
修改方法:
requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_list);
2.在dialog.show()方法前调用了dialog.setContentView()或者dialog.getWindow()
dialog.setContentView(R.layout.activity_main); //或者是调用了 dialog.getWindow(); dialog.show();
修改方法:
dialog.show(); dialog.setContentView(R.layout.activity_main);
3. ***activity继承了ActionBarActivity,然后调用requestWindowFeature(Window.FEATURE_NO_TITLE);报异常
修改方法:使***activity继承自 Activity