Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun isConnected() : Boolean
- {
- connectivity = context.getSystemService(Service.CONNECTIVITY_SERVICE) as ConnectivityManager
- if(connectivity != null)
- {
- info = connectivity!!.activeNetworkInfo
- if(info != null)
- {
- if(info!!.state == NetworkInfo.State.CONNECTED)
- {
- return true
- }
- }
- }
- return false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement