I am trying to update an existing feature and it's giving this error
here is the code.
selectedFeatureLayer.getFeatureTable().updateFeature(selectedFeature.getId(), feature);
Can you please share your error message?
I only see the method call that you are making.
The error message is "unable to open the database file". The weird thing is that sometimes it works and the feature gets updated successfully. I don't really know what's causing this issue.
here is the code :
try {
TemplatePicker tp = context.getTemplatePicker();
MapView map = context.getMapView();
GeodatabaseFeature g = ((GeodatabaseFeatureTable) ((FeatureLayer) map.getLayerByID(tp.getSelectedLayer().getID())).getFeatureTable()).createFeatureWithTemplate(tp.getselectedTemplate(), geometryBeingEdited);
Symbol symbol = ((FeatureLayer) map
.getLayerByID(tp
.getSelectedLayer().getID())).getRenderer()
.getSymbol(g);
addedGraphic = new Graphic(geometryBeingEdited, symbol, g.getAttributes());
updatedfeatureId = ((FeatureLayer) map.getLayerByID(tp.getSelectedLayer().getID())).getFeatureTable().addFeature(addedGraphic);
} catch (TableException e) {
e.printStackTrace();
}
To follow up, we discussed this offline and it looked as though it was a caching issue in the code / on the device and that is what prevented the geodatabase file from opening.