"삭제"버튼을 클릭하면 팝업 대화 상자 옵션이 표시됩니다. 그러나 버튼을 클릭하면 응답이 없습니다. 오류가 발생하지 않습니다 내가 뭔가를 완벽하게 놓치고 있는지 궁금하네요.Android : 대화 상자에서 응답이 없습니다.
deleteModule = (Button)findViewById(R.id.deleteButton);
deleteModule.setOnClickListener(this);
}
public void onClick (View deleteModule)
{
Dialog(rowId);
}
public void Dialog (final String rowId) {
// Use the Builder class for convenient dialog construction
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(R.string.confirmDelete)
.setPositiveButton(R.string.confirmDelete, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
MODULEDATABASE = new database(ViewCourse.this);
MODULEDATABASE.deleteRow(rowId);
Intent intent = new Intent(ViewCourse.this, MyCourses.class);
startActivity(intent);
}
})
.setNegativeButton(R.string.confirmDelete, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
}).create();
}
양수 버튼의'OnClickListener' 실행 중'onClick' 메소드가 실행되고 있습니까? –
'Dialog'는 정말 나쁜 메소드 이름입니다. 'AlertDialog' 기본 클래스는'Dialog'입니다. – jbowes
아니요, 팝업이 전혀 없습니다. – Calgar99