How to solve requestFeature() must be called before adding content in android

前端 未结 1 1233
日久生厌
日久生厌 2021-01-16 23:37

I am creating an application that consists of the simple and small registration form pop up in an alert dialog when we click a button. But it was showing an error called

相关标签:
1条回答
  • 2021-01-16 23:45

    Problem is caused by MaterialDesignLibrary.due to following line in Dialog class:

    @Override
    protected void onCreate(Bundle savedInstanceState) {
     requestWindowFeature(Window.FEATURE_NO_TITLE);
     ....
    }
    

    here requestWindowFeature is called after calling setContentView method in Activity.

    To fix this issue you should remove requestWindowFeature(Window.FEATURE_NO_TITLE); line from Dialog class of library

    0 讨论(0)
提交回复
热议问题