java.net.SocketException: Network is unreachable: connect

You are facing a connection breakdown. Does this happen in 3G, WiFi or "plain" connection on a computer?

Anyway, you must assume that the connection may be lost from time to time, when writing your app. For example, with mobiles, this happens frequently in the tube, in basements, etc. With PC apps, this is less frequent but occurs sometimes.

A retry can be a good solution. And a clean error message that explains the network is not available at this moment too.