无法调试从Kotlin中的Channel接收的变量

时间:2018-06-01 08:17:41

标签: android kotlin

A有一个像下面的Kotlin频道。当我在Log行放置断点时,我希望能够在Android Studio中看到测试变量,但我不能。

 val channel = Channel<Int>()
 launch {
     val test = channel.receive()
     Log.d(test.toString()) <--- Breakpoint set here
 }

 launch {
     channel.send(1)
 }

当我在断点处停止时,会在Android Studio调试器中显示。

this = {Test$test$8@7232} 
   $channel = {RendezvousChannel@7435} 
   p$ = {StandaloneCoroutine@7478} 
   _context = {CombinedContext@7483} 
   _facade = {DispatchedContinuation@7484} 
   completion = {StandaloneCoroutine@7478} 
   label = 1
   arity = 2
   shadow$_klass_ = {Class@7194} ""
   shadow$_monitor_ = -1282289382

0 个答案:

没有答案