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
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)