Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean haveNetworkConnection()
- {
- ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
- NetworkInfo netInfo = cm.getActiveNetworkInfo();
- if (netInfo == null)
- return false;
- else
- {
- if(netInfo.isConnected())
- return true;
- else
- return false;
- }
- }
Add Comment
Please, Sign In to add comment