回答編集履歴
1
コード例修正
test
CHANGED
@@ -4,9 +4,33 @@
|
|
4
4
|
|
5
5
|
```kotlin
|
6
6
|
|
7
|
+
object : CountDownTimer(4000,100){
|
8
|
+
|
9
|
+
override fun onTick(p0: Long) {
|
10
|
+
|
11
|
+
if (p0 > 300) {
|
12
|
+
|
13
|
+
count.text = "${p0 / 1000}"
|
14
|
+
|
15
|
+
} else {
|
16
|
+
|
17
|
+
count.text = "開始"
|
18
|
+
|
19
|
+
}
|
20
|
+
|
21
|
+
}
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
override fun onFinish() {
|
26
|
+
|
7
27
|
val intent = Intent(this@Lv8Activity, Lv8MainActivity::class.java)
|
8
28
|
|
9
29
|
startActivity(intent)
|
30
|
+
|
31
|
+
}
|
32
|
+
|
33
|
+
}.start() // startがないとカウントダウンが始まらないのでは
|
10
34
|
|
11
35
|
```
|
12
36
|
|