Skip to content

Instantly share code, notes, and snippets.

@codingwithsara
Last active May 4, 2019 01:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codingwithsara/e9a0b16637598db06a1a2587e4e12cc7 to your computer and use it in GitHub Desktop.
Save codingwithsara/e9a0b16637598db06a1a2587e4e12cc7 to your computer and use it in GitHub Desktop.
Android Studio Quiz2 2-3
answerBtn3 = findViewById(R.id.answerBtn3);
answerBtn4 = findViewById(R.id.answerBtn4);
// クイズデータquizDataからクイズ出題用のquizArrayを作成する
for (int i = 0; i < quizData.length; i++) {
// 新しいArrayListを用意
ArrayList<String> tmpArray = new ArrayList<>();
// クイズデータを追加
tmpArray.add(quizData[i][0]); // 画像名
tmpArray.add(quizData[i][1]); // 正解
tmpArray.add(quizData[i][2]); // 選択肢1
tmpArray.add(quizData[i][3]); // 選択肢2
tmpArray.add(quizData[i][4]); // 選択肢3
// tmpArrayをquizArrayに追加
quizArray.add(tmpArray);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment