Quick fix for NetworkOnMainThreadException

前端 未结 3 1548
轻奢々
轻奢々 2020-12-03 22:01

I need to execute third-party open source program, which throws NetworkOnMainThreadException. According to SDK reference, this is only thrown for applications targeting the

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 22:27

    These are not solutions, you Just tell the tutelar to sleep and sill!!! the android decide not to let you make network operations in the main thread (UI thread), because of the "halts" that these operation can make (the ui stop respond). So, as I read, they tell you to not shoot your leg, and you find the way to do!!!

    the solution : separated thread, Or Async ...

提交回复
热议问题