diff --git a/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt index bcd4301496..1148d63378 100644 --- a/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt +++ b/modules/mogo-module-splash/src/main/java/com/zhidao/mogo/module/splash/fragment/BydSplashFragment.kt @@ -34,12 +34,14 @@ class BydSplashFragment :MvpFragment(),Han override fun handleMessage(msg: Message): Boolean { if (msg.what == MSG_COUNT_DOWN) { - countDownTime-- - if(countDownTime>0) { - tvCountDown.text = countDownTime.toString() - handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY) - }else{ - hideSplash() + tvCountDown?.also { + countDownTime-- + if(countDownTime>0) { + it.text = countDownTime.toString() + handler.sendEmptyMessageDelayed(MSG_COUNT_DOWN, DEFAULT_COUNT_DOWN_DELAY) + }else{ + hideSplash() + } } return true }