Select to view content in your preferred language

Create a map, layer, or geodatabase from selected features?--ArcGIS Runtime SDK for Android

737
2
02-22-2018 04:22 PM
CoraColeman
Regular Contributor

Is there a way to save all of the features that are selected from a feature layer in selection mode to a new feature layer, geodatabase, or map to be displayed in the app?

0 Kudos
2 Replies
ShellyGill1
Esri Contributor

Hi Cora,

I'm afraid there's currently no way in the Runtime SDK to create new FeatureLayers from scratch. If you're displaying the same layer again, and want to reselect the same features as were selected last time, then you could try persisting the ObjectIDs of the features returned from `FeatureLayer.getSelectedFeaturesAsync`, and then re-select them when the app restarts with `FeatureLayer.selectFeaturesAsync` (you'd have to build a query containing all the IDs).

Hope this helps some,

Shelly

CoraColeman
Regular Contributor

Okay, thank you! Do you think I could do something similar by implementing the feature layer definition expression sample code? If I update the selected features on a field named "temp_selected" with the string attribute "selected" and then set that field and string to be the expression for the feature_layer like: feature_layer.setDefinitionExpression("temp_selected = 'selected'"). Could this work for displaying only those features that were selected on the map using the button on the bottom toolbar that is set up in the sample code?

0 Kudos