如何编写重启按钮?

时间:2019-05-08 00:35:12

标签: android kotlin

我想为我的第一个小项目(游戏)创建一个“重新启动按钮”,但是在搜索WWW几个小时后没有任何线索。 尝试实现一些东西!

hideImages()

    object : CountDownTimer(60000,1000) {
        override fun onFinish() {
                timeText.text = "TIME OVER"
                handler.removeCallbacks(runnable)
            for (image in imageArray)
                image.visibility = View.INVISIBLE
        }

        override fun onTick(millisUntilFinished: Long) {
                timeText.text = "Time " + millisUntilFinished / 1000
        }


    }.start()
}


    fun hideImages() {


        runnable = object : Runnable {
            override fun run() {

                for (image in imageArray) {

                    image.visibility = View.INVISIBLE

0 个答案:

没有答案