質問編集履歴

1

タイトルの修正&findViewByldの位置修正

2021/02/07 21:53

投稿

jessy_iida
jessy_iida

スコア5

test CHANGED
@@ -1 +1 @@
1
- XML&Ktolineにて、ボタンを押すごとにランダムで数字が変わるアプリを制作中に大量のエラー発生
1
+ XML&Kotlinにて、ボタンを押すごとにランダムで数字が変わるアプリを制作中に大量のエラー発生
test CHANGED
@@ -286,7 +286,7 @@
286
286
 
287
287
  var answerCount: Int = 0
288
288
 
289
- var textView = findViewById<TextView>(R.id.textView)
289
+ ~~var textView = findViewById<TextView>(R.id.textView)~~
290
290
 
291
291
 
292
292
 
@@ -298,6 +298,10 @@
298
298
 
299
299
 
300
300
 
301
+ var textView = findViewById<TextView>(R.id.textView)
302
+
303
+
304
+
301
305
  for (i in 0 until QUESTION_COUNT){
302
306
 
303
307
  val number = random.nextInt(1000)