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