Skip to content

Instantly share code, notes, and snippets.

@codingwithsara codingwithsara/MainActivity.java Secret
Last active Oct 15, 2018

Embed
What would you like to do?
3-6
answerBtn3 = (Button)findViewById(R.id.answerBtn3);
answerBtn4 = (Button)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
You can’t perform that action at this time.