在我的CallType
课堂上,我将注入的数据connectivityState.callBackState
设置为 true,在ConnectivitySte
课堂上将其初始化为 false。但是在我的IncomingCallBroadcastReceiver
课堂上,我的布尔数据callBackState
不是true
but false
。
class CallType {
val kodein = Kodein {
bind<ConnectivityState>() with provider { ConnectivityState() }
}
private val connectivityState: ConnectivityState = kodein.instance()
fun call(number: String) {
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\\
connectivityState.callBackState = true
}
class IncomingCallBroadcastReceiver : KodeinBroadcastReceiver() {
private val connectivityState: ConnectivityState by instance()
override fun onBroadcastReceived(context: Context, intent: Intent) {
//!!!!!!!!!!!!!! IT'S FALSE HERE WHEREAS I PUT IT TO TRUE IN CALLTYPE CLASS
if (connectivityState.callBackState) {
}
}
class ConnectivityState {
var iaxState = false
}