Guest User

Untitled

a guest
Jul 18th, 2014
1,619
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public boolean isInternetAvailable() {
  2. try {
  3. InetAddress ipAddr = InetAddress.getByName("google.com");
  4.  
  5. if (ipAddr.equals("")) {
  6. return false;
  7. } else {
  8. return true;
  9. }
  10.  
  11. } catch (Exception e) {
  12. return false;
  13. }
  14.  
  15. }
RAW Paste Data