Back to project page SmartMap.
The source code is released under:
Apache License
If you think the Android project SmartMap 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.dennytech.smartmap.impl.autonavi; /*from w w w. j av a 2 s . com*/ import android.content.Intent; import android.os.Bundle; import com.amap.mapapi.map.MapActivity; import com.dennytech.smartmap.SMMapFragment; /** * Base activity for display autonavi map, if there is no google map api, you * should use this one. * * @author Jun.Deng * */ public abstract class ANMapActivity extends MapActivity { protected SMMapFragment mMapFragment; protected abstract SMMapFragment createFragment(); @Override public void onAttachedToWindow() { super.onAttachedToWindow(); mMapFragment.onAttach(this); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mMapFragment = createFragment(); if (mMapFragment != null) { mMapFragment.attachActivity(this); mMapFragment.onCreate(savedInstanceState); setContentView(mMapFragment.onCreateView(getLayoutInflater(), savedInstanceState)); mMapFragment.onActivityCreated(savedInstanceState); } else { throw new IllegalAccessError("you must create a SMMapFragment first"); } } @Override protected void onStart() { super.onStart(); mMapFragment.onStart(); } @Override protected void onResume() { super.onResume(); mMapFragment.onResume(); } @Override protected void onPause() { super.onPause(); mMapFragment.onPause(); } @Override protected void onStop() { super.onStop(); mMapFragment.onStop(); } @Override protected void onDestroy() { if (mMapFragment != null) { mMapFragment.onDestroy(); } super.onDestroy(); } @Override public void onDetachedFromWindow() { mMapFragment.onDetach(); super.onDetachedFromWindow(); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); mMapFragment.onActivityResult(requestCode, resultCode, data); } @Override protected boolean isRouteDisplayed() { return true; } }