Code example for UnknownHostException

Methods: egetMessage

0
				inetAddress = InetAddress.getByAddress(byteaddr);
				s.append("tcp://");
				s.append(inetAddress.getHostAddress());
				s.append(":" + server.getPort() + "/");
			} catch (UnknownHostException e) {
				Log.e(TAG, e.getMessage(), e);
				s.delete(0, s.length());
				s.append(e.getMessage());
			} 
		} else { 
			s.append("Wifi should be enabled !");
		} 
		return s.toString();
	} 
 
} 
Contextual code suggestions in your IDE  Get Codota for Java