Back to project page android-maps-utils.
The source code is released under:
Apache License
If you think the Android project android-maps-utils listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.google.maps.android.utils.demo; //from ww w.j a v a2s. com import android.os.Bundle; import android.support.v4.app.FragmentActivity; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; public abstract class BaseDemoActivity extends FragmentActivity { private GoogleMap mMap; protected int getLayoutId() { return R.layout.map; } @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(getLayoutId()); setUpMapIfNeeded(); } @Override protected void onResume() { super.onResume(); setUpMapIfNeeded(); } private void setUpMapIfNeeded() { if (mMap != null) { return; } mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); if (mMap != null) { startDemo(); } } /** * Run the demo-specific code. */ protected abstract void startDemo(); protected GoogleMap getMap() { setUpMapIfNeeded(); return mMap; } }