'StrictMode doesn't detect Network call on MainThread when using viewModelScope.launch [closed]
While using viewModelScope.launch to make Network call I forgot to add withContext(Dispatchers.IO). When I tried to check using StrictMode ThreadPolicy it didn't throw any exception .But when I checked whether I am on the main thread using boolean isUiThread = VERSION.SDK_INT >= VERSION_CODES.M ? Looper.getMainLooper().isCurrentThread() : Thread.currentThread() == Looper.getMainLooper().getThread(); it showed that I am on the main thread . Anyone know why this is happening .
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
