Here is my code:
final HttpURLConnection conn = (HttpURLConnection) sourceURL.openConnection();
if (cachedPage != null) {
if (cachedPage.eTag
Or shorter :)
Just try set connection timeout other than 0.
conn.setConnectionTimeout( 3000);
Do it after .openConnection()
final HttpURLConnection conn = (HttpURLConnection) sourceURL.openConnection();
conn.setConnectionTimeout( 3000);
If not set also readTimeout other than 0.
conn.setReadTimeout( 3000);