@Override protected void onResume() { if (mBMapMan != null) { mBMapMan.start(); } super.onResume(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mapView = (MapView) findViewById(R.id.bmapview); mbtnAdress = (Button) findViewById(R.id.btnAddress); mbtnAdress.setOnClickListener(this); mbtnLine = (Button) findViewById(R.id.btnLine); mbtnLine.setOnClickListener(this); bMapManager = new BMapManager(this); bMapManager.init( key, new MKGeneralListener() { @Override public void onGetPermissionState(int arg0) { // TODO Auto-generated method stub if (arg0 == 300) { Toast.makeText(MainActivity.this, "输入的key有误", 1); } } @Override public void onGetNetworkState(int arg0) {} }); bMapManager.start(); initMapActivity(bMapManager); mapView.setBuiltInZoomControls(true); // 设置中心点 mkSearch = new MKSearch(); mkSearch.init(bMapManager, new MySearchListener(this, mapView)); }
@Override protected void onResume() { // TODO Auto-generated method stub super.onResume(); if (bMapManager != null) { bMapManager.start(); } }
protected void initMapActivity() { super.initMapActivity(mapManager); mapManager.start(); }
@Override protected void onResume() { mapManager.start(); super.onResume(); }