--- android/TrainInfo/src/dk/thoerup/traininfo/provider/OfflineStationProvider.java 2011/11/25 09:16:29 1626 +++ android/TrainInfo/src/dk/thoerup/traininfo/provider/OfflineStationProvider.java 2011/11/25 10:20:40 1627 @@ -86,20 +86,22 @@ byte data[] = HttpUtil.getContent(XmlUtil.SERVICE_BASE + "/LocateStations?dump=1", 5000); Serializer serializer = new Persister(); - stations = serializer.read(StationBean.class, new String(data, "ISO-8859-1") ); + StationBean tmpStations = serializer.read(StationBean.class, new String(data, "ISO-8859-1") ); ObjectOutputStream out = new ObjectOutputStream( new FileOutputStream(stationsFile) ); Log.e("OFFLINE", "data size" + data.length); - out.writeInt( stations.entries.size() ); //start with writing the length of the dataset + out.writeInt( tmpStations.entries.size() ); //start with writing the length of the dataset - for (StationEntry entry : stations.entries) { + for (StationEntry entry : tmpStations.entries) { updateSearchStrings( entry ); //prepare name fields for byName search out.writeObject(entry); } - out.close(); + out.close(); + + stations = tmpStations; // når alt er ok skifter vi over til ny udgave }