主线程的两种调度:
1. uiScope.launch {
SimUtils.getInstance().setSimChannel(-1) {
CoroutineScope(Dispatchers.Main).launch { //调度
if (SimUtils.getInstance().getSimChannel() == 0) {
binding.top.tvTelecomType.text = getString(R.string.telecom)
dismissProgress()
} else if (SimUtils.getInstance().getSimChannel() == 1) {
binding.top.tvTelecomType.text = getString(R.string.cicmcc)
dismissProgress()
}
otherSetPop.changeSwitchToBuiltIn(
SimUtils.getInstance().getSimChannel()
)
}
}
}
uiScope.launch {
withContext(Dispatchers.Main) { //调度
binding.tvArea.text =
NumberUtils.format(popWindowArea.realAreaValue.toDoubleAlly(), 3)
}
}