@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mContext = this; setContentView(R.layout.activity_map); // Obtain the SupportMapFragment and get notified when the map is ready to be used. SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); mapFragment.getMapAsync(this); }
@Override protected void onDestroy() { if (!bitmap_mapping.isEmpty()) { for (int key : bitmap_mapping.keySet()) { Bitmap bm = bitmap_mapping.get(key); if (bm != null && !bm.isRecycled()) { bm.recycle(); bm = null; } } } bitmap_mapping = null; super.onDestroy(); }