Android : Android Maps V2 tiles not updating

on Thursday, September 18, 2014


The tiles of the map are not being updated, the only way to update them is to block the device (onPause called) and to unblock the device (onResume called). If i do that, the tiles become updated.... it is very strange


this is my code:



public class MainActivity extends Activity {
MapView map;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LinearLayout main = new LinearLayout(this);
main.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT));

GoogleMapOptions options = new GoogleMapOptions();
options.mapType(GoogleMap.MAP_TYPE_SATELLITE)
.compassEnabled(false)
.rotateGesturesEnabled(false)
.tiltGesturesEnabled(false);

options.camera(new CameraPosition(new LatLng(0, 0), 1, 0, 0));

map = new MapView(this, options);
map.onCreate(savedInstanceState);
main.addView(map);

setContentView(main);
}

@Override
protected void onPause() {
// TODO Auto-generated method stub
super.onPause();
map.onResume();
}

@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
map.onPause();
}


}

0 comments:

Post a Comment