Android Instrumentation Testing - UI Thread Issues

前端 未结 5 1025
走了就别回头了
走了就别回头了 2020-12-30 22:16

I am trying to write an Instrumentation Test for my Android app.

I\'m running into some weird threading issues and I can\'t seem to find a solution.

My

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-30 22:49

    With the androidx test runner a new class was added UiThreadStatement that gives a runOnUiThread method for this.

            UiThreadStatement.runOnUiThread {
               // call activity here 
            }
    

提交回复
热议问题