Created
June 11, 2013 06:56
-
-
Save tomoyamkung/5754933 to your computer and use it in GitHub Desktop.
[Android]AlertDialog のスニペット(キャンセル時のリスナー付き)。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new AlertDialog.Builder(this) | |
.setTitle("TITLE") | |
.setMessage("Message") | |
.setPositiveButton( | |
"OK", | |
new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
// OK ボタンがタップされたときの処理 | |
} | |
} | |
) | |
.setNegativeButton( | |
"NG", | |
new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialog, int which) { | |
// NG ボタンがタップされたときの処理 | |
} | |
} | |
) | |
.setOnCancelListener(new DialogInterface.OnCancelListener() { | |
@Override | |
public void onCancel(DialogInterface dialog) { | |
// キャンセルされたときの処理 | |
} | |
}) | |
.show(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment