Here's a bit of code I got:
('layer' is a ArcGISDynamicMapServiceLayer already initialized)
ArcGISLayerInfo[] childLayers = layer.getAllLayers();
for (ArcGISLayerInfo child : childLayers) {
LayerServiceInfo serviceInfo = child.getLayerServiceInfo();
for (Field field : serviceInfo.getFields()) {
childInfo.addFieldName(field.getName());
}
....
}
When I print the serviceInfo.toString(), I get:
Layers [id=4, name=Lage druk, defaultVisibility=true, parentLayerId=-1,
subLayerIds=[5, 19, 20, 21, 22],
geometryType=null,
fields=null,
objectIdField=null, globalIdField=null, typeIdField=null,
featureTypes=null,
hasAttachments=false,
definitionExpression=null]
Can I have access to the fields of an DynamicMapServiceLayer like this?
Thanks,