The Display Drawing Status app shows how to use the DrawStatus
value representing drawing state of the MapView
to display an Android ProgressBar
while the map is loading.
- ArcGISMap
- MapView
- ServiceFeatureTable
- DrawStatus
- DrawStatusChangedEvent
- DrawStatusChangedListener
The listener interface for receiving DrawStatus
changed events from the MapView
:
mMapView.addDrawStatusChangedListener(new DrawStatusChangedListener() {
@Override
public void drawStatusChanged(DrawStatusChangedEvent drawStatusChangedEvent) {
if(drawStatusChangedEvent.getDrawStatus() == DrawStatus.IN_PROGRESS){
progressBar.setVisibility(View.VISIBLE);
Log.d("drawStatusChanged", "spinner visible");
}else if (drawStatusChangedEvent.getDrawStatus() == DrawStatus.COMPLETED){
progressBar.setVisibility(View.INVISIBLE);
}
}
});