Getting Values Of Edit Text Error NULLPOINTER Why?
I'm trying to get text from values of edit field showed on a dialog and save it in a variable. final Dialog dialog = new Dialog(context); dialog.setContentView(R.layout.dialg); di
Solution 1:
Try instead
EditText edt1=(EditText)dialog.findViewById(R.id.EditTextNom);
you need to look in the layout that is inflated for the Dialog
. Right now it is looking in the one that was inflated for the Activity
and, obviously, those View
s don't exist in that layout
.
Post a Comment for "Getting Values Of Edit Text Error NULLPOINTER Why?"