Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created November 5, 2024 11:57
Show Gist options
  • Save codeforfun-jp/6b368cfa0b2829d09fd5a8b82f5275b2 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/6b368cfa0b2829d09fd5a8b82f5275b2 to your computer and use it in GitHub Desktop.
[Java Quiz ver2] 7-2
@Override
public void onClick(View v) {
/* 省略 */
new MaterialAlertDialogBuilder(this)
.setTitle(alertTitle)
.setMessage("答え : " + rightAnswer)
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (quizCount == QUIZ_COUNT) {
// 結果画面へ移動
Intent intent = new Intent(MainActivity.this, ResultActivity.class);
intent.putExtra("RIGHT_ANSWER_COUNT", rightAnswerCount);
startActivity(intent);
} else {
quizCount++;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment