EAndroidRuntime FATAL EXCEPTION main Process comexamplelivedata PID 16940 javalangRuntimeException Unable to start activity ComponentInfocomexamplelivedatacomexamplelivedataMainActivity kotlinUn
该错误是由于在MyViewModel类的currentSecond属性没有初始化的情况下尝试访问该属性导致的。在MyViewModel中,您需要确保在使用该属性之前将其初始化。您可以使用lateinit关键字来延迟初始化属性,但是必须确保在访问该属性之前进行初始化。
原文地址: https://www.cveoy.top/t/topic/irEf 著作权归作者所有。请勿转载和采集!