private Document getDocument(String woeid) { try { boolean celcius = WeatherPrefs.getUseCelcius(getApplicationContext()); String urlWithDegreeUnit; if (celcius) { urlWithDegreeUnit = URL_YAHOO_API_WEATHER + "c"; } else { urlWithDegreeUnit = URL_YAHOO_API_WEATHER + "f"; } return httpRetriever.getDocumentFromURL(String.format(urlWithDegreeUnit, woeid)); } catch (IOException e) { Log.e(TAG, e.toString()); } return null; }