반응형
간단한 타이머 기능
/**
* music timer
*/
var mTimer: Timer?= null
fun runTimer(){
if (mTimer == null){
mTimer = timer(period = 600){
currentDuration()
}
}
}
fun stopTimer(){
mTimer?.let {
it.cancel()
}
mTimer = null
}
반응형
'AOS' 카테고리의 다른 글
(안드로이드) To get local formatting use getDateInstance(), getDateTimeInstance(), or getTimeInstance(), or use new SimpleDateFormat(String template, Locale locale) with for example Locale.US for ASCII dates. (0) | 2021.07.10 |
---|---|
(안드로이드) 키보드 관련 정리 (0) | 2021.06.25 |
(안드로이드) git 꼬엿을때. (0) | 2021.06.02 |
(안드로이드) constraintLayout animation (0) | 2021.06.01 |
(Android) 트위치 App 3 - retrofit2 (0) | 2021.04.19 |