Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

activeNetworkInfo depricated

fun isNetworkAvailable(context: Context) =
    (context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager).run {
        getNetworkCapabilities(activeNetwork)?.run {
            hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR)
                || hasTransport(NetworkCapabilities.TRANSPORT_WIFI)
                || hasTransport(NetworkCapabilities.TRANSPORT_ETHERNET)
        } ?: false
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# azure get vm get cpu usage 
Csharp :: Request ID: XPBBR4XG1UWuX6fWF08_-jzYkrommVJjO7Os50CTYuZmiw7kMsFUkw== 
Csharp :: windows forms add onclick 
Csharp :: c sharp making our custom function 
Csharp :: c# getdecimal null 
Csharp :: create new directory netrw 
Csharp :: c# find the smallest string in an array of strings 
Csharp :: how to extract unique years from a list of different years in c# 
Csharp :: c# hardcode datetime quoting 
Csharp :: C# Zip large files causes OOM exception 
Csharp :: c# string with double quotes inside 
Csharp :: worsening 
Csharp :: unity customize hierarchy window 
Csharp :: How to get the value of an input button in an ASP.NET Core MVC controller 
Csharp :: how to open or close combobox in c# 
Csharp :: pun 2 matchmaking custom room properties 
Csharp :: Initalize C# project in VS Code 
Csharp :: CharacterController 
Csharp :: ArgumentOutOfRangeException when sorting a DataGridView using a custom IComparer 
Csharp :: Make child unaffected by parents rotation Unity 
Csharp :: encode < for xml 
Csharp :: get last id ef 
Csharp :: cassandra Keyspaces repository .net 
Csharp :: ExpandoObject Syntax that Compile 
Csharp :: tee into file 
Csharp :: datagridview show noti each row column 
Csharp :: C# devexpress get foucused dataRow of child gridView 
Csharp :: how to mock abstract httpcontext using moq .net core 
Csharp :: Set orientation of moving object towards it movement direction 
Csharp :: wait for threadpool to complete with decrement 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =