StrictMode java.lang.Throwable: Untagged socket detected

后端 未结 3 1492
陌清茗
陌清茗 2021-02-07 15:52

With StrictMode enabled I just started getting this exception:

java.lang.Throwable: Untagged socket detected; use TrafficStats.setThreadSocketTag() to tra

3条回答
  •  生来不讨喜
    2021-02-07 16:29

    My solution has been to call on initialisation the following:

    private static final int THREAD_ID = 10000;
    TrafficStats.setThreadStatsTag(THREAD_ID);
    

提交回复
热议问题