@Override protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context) { super.doRestoreState(rs, context); Boolean booleanState = rs.getStateValueAsBoolean(context, "enableCaps"); if (booleanState != null) this.setEnableCaps(booleanState); List<LatLon> locations = rs.getStateValueAsLatLonList(context, "locations"); if (locations != null) this.setLocations(locations); }
@Override protected void doRestoreState(RestorableSupport rs, RestorableSupport.StateObject context) { super.doRestoreState(rs, context); RestorableSupport.StateObject so = rs.getStateObject(context, "layers"); if (so == null) return; RestorableSupport.StateObject[] lsos = rs.getAllStateObjects(so, "layer"); if (lsos == null || lsos.length == 0) return; ArrayList<Layer> layerList = new ArrayList<Layer>(lsos.length); for (RestorableSupport.StateObject lso : lsos) { if (lso != null) { Layer layer = new Layer(); layer.doRestoreState(rs, lso); layerList.add(layer); } } this.setLayers(layerList); }