NullPointerException on EditText located in Dialog

后端 未结 2 1423
故里飘歌
故里飘歌 2021-01-17 05:39

Here is my email_dialog.xml layout:



        
相关标签:
2条回答
  • 2021-01-17 06:08

    You should do this:

     final EditText txtEA = (EditText) dialog.findViewById(R.id.txtEmailAddress5);
    

    You forgot to search for the txtEA in dialog.

    0 讨论(0)
  • 2021-01-17 06:16
    final EditText txtEA = (EditText) dialog.findViewById(R.id.txtEmailAddress5);
    

    You must call findViewById on dialog.

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