我想在初始化ViewModel时发出API请求。当我在活动中注入s why I make API request inside时,将触发method; expectinginit init‘。我做错了什么?class MainViewModel @Inject constructor(private val mainRepository: MainRepo) : ViewModel() { var TAG = "MainViewModel**"
init {
(PersistenceServiceManager.java:136) at com.filter.PortalActionFilter.myInit(PortalActionFilter.java:(ContainerMapper.java:195) at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860:513) at java.lang.Thread.run(Thread.java:66