val CountDownTimer=object: CountDownTimer(10000,1000){
override fun onTick(millisUntilFinished: Long) {
txtTimer.setText(millisUntilFinished/1000)
}
override fun onFinish() {
Toast.makeText(this@Play_Area,"Time up",Toast.LENGTH_SHORT).show()
}
}
CountDownTimer.start()
I am passing countdown to the xml in onTick funtion it is showing following error in setText :
None of the following functions can be called with the arguments supplied: public final fun setText(p0: CharSequence!): Unit defined in android.widget.TextView public final fun setText(p0: Int): Unit defined in android.widget.TextView
Please help...
txtTimer.setText((millisUntilFinished/1000).toString())
– IntelliJ Amiya