Reputation: 51
How could I possibly get the radiobutton that was checked in a custom dialog. I have a custom dialog with 2 radiobuttons in it but everytime I clicked the radiobutton, a null pointer exception occurs.
Upvotes: 1
Views: 675
Reputation: 1520
While initialising the radio button use RadioButton rb = (RadioButton)dialog.findViewById(R.id.radiobutton);
instead of RadioButton rb = (RadioButton)findViewById(R.id.radiobutton);
Upvotes: 1