@Override protected String doInBackground(Location... locations) { Location lCityLocation = locations[0]; // Location values in Regions class Region.setMyLocation_latitude(String.valueOf(lCityLocation.getLatitude())); Region.setMyLocation_longitude(String.valueOf(lCityLocation.getLongitude())); MainActivity.weatherJSONResponse = WeatherInfo.getWeatherInfo(lCityLocation); return MainActivity.weatherJSONResponse; }