AnsweredAssumed Answered

Problems with using MapView.setMapOptions() or MapView.centerAndZoom()

Question asked by on Jul 27, 2016
Latest reply on Jul 28, 2016 by ANohe-esristaff

Hallo everybody,

i just made some Tutorials with the Esri Android API including the "Use ArcGIS basemaps" and everything worked fine. Now I want to implement a MapView into my own App and there are some problems with it:


What I have done:

I declared the MapView in my XML-Layout File and refer to it per "". In my java-File Irefer to it and set some additional parameters like "mMapView.setEsriLogoVisible(true);" etc. and everything works fine until I reach the point where I want to change the initial View of the Map dynamically. So I tried ".setMapOptions" as well as ".centerAndZoom" nothing works here.


What I tried:

I remembered, that it was working fine in the Tutorial so I tried a few things out and saw, that the View changed if I wait a few seconds after initializing the MapView in java code. I created a timer and it worked. Also with a Button it worked fine. But if I try it directly after the initialisation it wont.


After that i tried to use the "OnStatusChangedListener" because I thougt it might work if the Map will be completely initialized, but here happens nothing as well. Tha map just appears at the initial point declared in the xml file. If I delete the initial coordinates in my Layout-File the hole MapView won't beinitialized (referring to the Callback).


Main question short:

How do I know, when I can use MapView.setMapOptions to change the initial center and appearence of the Map?


My Code:



public class MissionControlActivity extends AppCompatActivity{

     private MapView mMapView = null;

     private MapOptions mMapOptionsSat = new MapOptions(MapType.SATELLITE, 43.971873, 6.161288, 9);



     protected void onCreate(Bundle savedInstanceState) {






     private void initUI(){

          mMapView = (MapView) findViewById(;



          mMapView.setMapOptions(mMapOptionsSat);            //This here doesn't work




<?xml version="1.0" encoding="utf-8"?>


   "33.666354, -117.903557"/>