I am trying to update an existing feature and it's giving this error
here is the code.
selectedFeatureLayer.getFeatureTable().updateFeature(selectedFeature.getId(), feature);
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.
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();
}
Can you please share your error message?
I only see the method call that you are making.
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.