Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Last active January 19, 2022 11:44
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 codeforfun-jp/2f9a22205ad4ecb4ab8aa9d9f81d1287 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/2f9a22205ad4ecb4ab8aa9d9f81d1287 to your computer and use it in GitHub Desktop.
Android Quiz App Kotlin 3-5
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
private var rightAnswer: String? = null
private var rightAnswerCount = 0
private var quizCount = 1
private val quizData = mutableListOf(
mutableListOf("北海道", "札幌市", "長崎市", "福島市", "前橋市"),
mutableListOf("青森県", "青森市", "広島市", "甲府市", "岡山市"),
mutableListOf("岩手県", "盛岡市", "大分市", "秋田市", "福岡市"),
mutableListOf("宮城県", "仙台市", "水戸市", "岐阜市", "福井市"),
mutableListOf("秋田県", "秋田市", "横浜市", "鳥取市", "仙台市"),
mutableListOf("山形県", "山形市", "青森市", "山口市", "奈良市"),
mutableListOf("福島県", "福島市", "盛岡市", "新宿区", "京都市"),
mutableListOf("茨城県", "水戸市", "金沢市", "名古屋市", "奈良市"),
mutableListOf("栃木県", "宇都宮市", "札幌市", "岡山市", "奈良市"),
mutableListOf("群馬県", "前橋市", "福岡市", "松江市", "福井市")
)
override fun onCreate(savedInstanceState: Bundle?) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment