私は私が私の活動のクラスのいずれかでのonClickを上書きしたいが、私は方法がわからないAndroidのオーバーライドAlertDialogのonClick
class Utility {
static void alertDialogShow(Context context, String title, String message) {
final AlertDialog alertDialog = new AlertDialog.Builder(context).create();
alertDialog.setTitle(title);
alertDialog.setMessage(message);
alertDialog.setButton(AlertDialog.BUTTON_POSITIVE, "OK",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
alertDialog.show();
}
私AlertDialogsのために別々の非アクティビティクラスでこのコードを使用しています。
アクティビティをクリックするためのインターフェイスを使用 –
またはカスタムダイアログを使用できます –