--- android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java 2010/02/08 19:12:15 588 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/banedk/DepartureFetcher.java 2010/05/03 07:42:02 697 @@ -6,6 +6,7 @@ import java.util.Map; import java.util.logging.Logger; +import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.html.DomNodeList; import com.gargoylesoftware.htmlunit.html.HtmlElement; @@ -81,7 +82,7 @@ List departureList = new ArrayList(); - final WebClient webClient = new WebClient(); + final WebClient webClient = new WebClient( BrowserVersion.FIREFOX_3 ); webClient.setTimeout(2500); webClient.setJavaScriptEnabled(false); @@ -131,12 +132,15 @@ String note = extractNote( fields.get(7) ); departure.setNote(note); + departure.setType(type); + departureList.add(departure); } } } else { logger.warning("No departures found for station=" + stationcode + ", type=" + type); } + webClient.closeAllWindows(); return departureList; } @@ -145,7 +149,7 @@ List departureList = new ArrayList(); - final WebClient webClient = new WebClient(); + final WebClient webClient = new WebClient(BrowserVersion.FIREFOX_3); webClient.setTimeout(2500); webClient.setJavaScriptEnabled(false); @@ -201,6 +205,8 @@ } else { logger.warning("No departures found for station=" + stationcode + ", type=" + type); } + webClient.closeAllWindows(); + return departureList; } @@ -249,7 +255,6 @@ } - return number; }