ダイアログのイベント応ずる

ダイアログを呼び出すときに、「OK」ボタンを押す、ダイアログのイベント応ずる:

1.Activityで、thisパラメーター渡す時、ダイアログのイベントはActivityに応ずる。 例えば:

1
2
3
4
//thisパラメーター渡す
TenkeyDialog tenkeyDialog = new TenkeyDialog(this, type, title, "",downOldValue);
tenkeyDialog.setMaxLength(maxLength);
tenkeyDialog.show();

2.Dialogで、dialog.setResult(this);を使用時、ダイアログのイベントはDialogに応ずる。 例えば:

1
2
3
4
5
int length = db.getColumnLength(currentCell.getColumnName());
InputTextDialog dialog = new InputTextDialog(context, title,currentCell.getValue(), length);
//thisパラメーター渡す
dialog.setResult(this);
dialog.show();