@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); mMapView = (MapView) findViewById(R.id.mapView); registerMapView(mMapView); MapRenderer.setBackgroundColor(0xff777777); mMap.layers().add(new TileGridLayer(mMap, Color.GRAY, 1.8f, 8)); if (USE_CACHE) { mCache = new TileCache(this, null, mTileSource.getClass().getSimpleName()); mCache.setCacheSize(512 * (1 << 10)); mTileSource.setCache(mCache); } mBitmapLayer = new BitmapTileLayer(mMap, mTileSource); mMap.layers().add(mBitmapLayer); // loooop(1); }
@Override protected void onDestroy() { super.onDestroy(); if (USE_CACHE) mCache.dispose(); }