Код: Выделить всё
override fun onScreenCall(details: Call.Details) {
if (details.callDirection == Call.Details.DIRECTION_INCOMING) {
details.handle?.schemeSpecificPart?.let { phoneNumber ->
Log.d("phoneNumber", "phoneNumber======$phoneNumber")
if (phoneNumber.isNotEmpty()) {
showCallInfoView(phoneNumber, blackList)
respondToCall(details, CallResponse.Builder().build())
}
}
}
}
Код: Выделить всё
when (state) {
TelephonyManager.CALL_STATE_IDLE -> {
mainHandler.post {
Log.d("CALL_STATE_IDLE-1", "CALL_STATE_IDLE")
windowManager?.removeView(customView)
}
}
Я пытался использовать val mainHandler = Handler(Looper.getMainLooper()), но не помогает.
Как это сделать?
Подробнее здесь: https://stackoverflow.com/questions/781 ... dowmanager
Мобильная версия