Hello! There was a problem with the identification of objects. mGeoElements equal to zero. what is the reason? how can I fix it? I can't get attributes because of this. ArcGIS Runtime SDK for Android 100.4.1
mSceneView.setOnTouchListener(new DefaultSceneViewOnTouchListener(mSceneView){
@Override
public boolean onSingleTapConfirmed(MotionEvent e) {
// get the screen point where user tapped
android.graphics.Point screenPoint = new android.graphics.Point((int) e.getX(), (int) e.getY());
// ...
final ListenableFuture<List<IdentifyLayerResult>> identifyFuture = mSceneView.identifyLayersAsync(screenPoint, 5,
false);
identifyFuture.addDoneListener(new Runnable() {
@Override
public void run() {
try {
List<IdentifyLayerResult> identifyLayersResults = identifyFuture.get();
StringBuilder message = new StringBuilder();
for (IdentifyLayerResult identifyLayerResult : identifyLayersResults) {
if (identifyLayerResult.getElements().size() > 0) {
GeoElement topmostElement = identifyLayerResult.getElements().get(0);
if (topmostElement instanceof Feature) {
Feature identifiedFeature = (Feature)topmostElement;
attr = topmostElement.getAttributes();
Set<String> keys = attr.keySet();
for (String key : keys) {
Object value = attr.get(key);
if(value != null) {
message.append(key + " | " + value + "\n");
}
}
}
}
}
showDialog(attr);