Created
July 24, 2020 19:24
-
-
Save vladimirpetrovski/c0482830d201db48d4e85f74686e1a4f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| val connectivityManager = getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { | |
| connectivityManager.bindProcessToNetwork(network) | |
| } else { | |
| ConnectivityManager.setProcessDefaultNetwork(network) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment