As you already have a pointer to your parent Activity
, simply changing the code to this should work:
EditText phone_number = (EditText) c.findViewById(R.id.phone_number);
At the moment, you are trying to find a view in the dialog's layout with the id R.id.phone_number
, but since that EditText is actually in the activity's layout it is not found in the dialog.