As still very young in android. am getting this error on this line in my code: new AlertDialog.Builder(context)
. The error I get is cannot resolve symbol(context
).
please kindly help,
case R.id.chk_clas1:
//do stuff
if (chk_clas1.isChecked()) {
if(c1.equals("0")){
adddate(txt_clas1);}
clas="1";
fdate=txt_clas1.getText().toString();
new AlertDialog.Builder(context)
.setTitle("Delete entry")
.setMessage("Are you sure you want to delete this entry?")
.setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// continue with delete
}
})
.setNegativeButton(android.R.string.no, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
// do nothing
}
})
.setIcon(android.R.drawable.ic_dialog_alert)
.show();
} else {
txt_clas1.setText("");
}