質問編集履歴
1
不要なコード削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,14 +32,6 @@
|
|
32
32
|
|
33
33
|
class MainActivity : AppCompatActivity() {
|
34
34
|
|
35
|
-
private lateinit var timer:CountDownTimer
|
36
|
-
|
37
|
-
private val startTime:Long=10000
|
38
|
-
|
39
|
-
var runningTime:Long = 0
|
40
|
-
|
41
|
-
private lateinit var mediaPlayer:MediaPlayer
|
42
|
-
|
43
35
|
|
44
36
|
|
45
37
|
override fun onCreate(savedInstanceState: Bundle?) {
|
@@ -50,31 +42,9 @@
|
|
50
42
|
|
51
43
|
|
52
44
|
|
53
|
-
val tv: TextView =findViewById(R.id.tv)
|
54
|
-
|
55
|
-
val btnStart:Button = findViewById(R.id.btnStart)
|
56
|
-
|
57
|
-
val btnStop:Button=findViewById(R.id.btnStop)
|
58
|
-
|
59
|
-
|
45
|
+
//中略
|
60
46
|
|
61
47
|
|
62
|
-
|
63
|
-
btnStart.setOnClickListener {
|
64
|
-
|
65
|
-
timer = countDownTimer(startTime).start()
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
btnStop.setOnClickListener {
|
72
|
-
|
73
|
-
timer.cancel()
|
74
|
-
|
75
|
-
tv.text ="${runningTime /1000}"
|
76
|
-
|
77
|
-
}
|
78
48
|
|
79
49
|
}
|
80
50
|
|
@@ -92,17 +62,11 @@
|
|
92
62
|
|
93
63
|
//TODO("Not yet implemented")
|
94
64
|
|
95
|
-
runningTime = p0
|
96
|
-
|
97
|
-
tv.text="${p0/1000}"
|
98
|
-
|
99
65
|
}
|
100
66
|
|
101
67
|
override fun onFinish() {
|
102
68
|
|
103
69
|
//TODO("Not yet implemented")
|
104
|
-
|
105
|
-
tv.text="おわり"
|
106
70
|
|
107
71
|
|
108
72
|
|