Hi I have written simple custom dialog . which has few check boxs and one submitt button .
whenever I tried to read the checkbox apllication throws Nullpointer exception .. can somebody helps to solve this , below is my custom dailog code
public void onClick(View arg0) {
// custom dialog
final Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.custom);
dialog.setTitle("Title...");
CheckBox chk1= (CheckBox) findViewById(R.id.chkbox1);
Button dialogButton = (Button) dialog.findViewById(R.id.dialogButtonOK);
// if button is clicked, close the custom dialog
dialogButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if(chk1.isChecked())
dialog.dismiss();
}
});
dialog.show();
}