Dialog problem: requestFeature() must be called before adding content

前端 未结 9 555
名媛妹妹
名媛妹妹 2020-12-31 02:39

I\'m creating a custom dialog containing an EditText so that I can get text data from the user:

final EditText newKey = (EditText) findViewById(R.id.dialog_r         


        
9条回答
  •  灰色年华
    2020-12-31 03:27

    I also had this error message when using a DialogFragment.

    My problem was solved when in the onCreateDialog(Bundle savedInstanceState) I changed the dialog that I returned

    from

    android.appAlertDialog

    to

    androidx.appcompat.app.AlertDialog

    (or if you haven't migrate to AndroidX, then android.support.v7.app.AlertDialog)

提交回复
热议问题