@Override
 protected void onDestroy() {
   // 退出时销毁定位
   if (mLocClient != null) mLocClient.stop();
   mMapView.destroy();
   super.onDestroy();
 }
예제 #2
1
 protected void onDestroy() {
   if (mLocClient != null) mLocClient.stop();
   mMapView.onDestroy();
   unregisterReceiver(mBaiduReceiver);
   Log.i(TAG, "[ACTIVITY] onDestroy");
   super.onDestroy();
 }
예제 #3
0
 private void stopListener() {
   // TODO Auto-generated method stub
   if (mLocationClient != null && mLocationClient.isStarted()) {
     mLocationClient.stop(); // �رն�λSDK
     mLocationClient = null;
   }
 }
예제 #4
0
 @Override
 protected void onDestroy() {
   if (mLocClient != null) mLocClient.stop();
   mMapView.onDestroy();
   unregisterReceiver(mBaiduReceiver);
   super.onDestroy();
 }
 @Override
 public void onDestroy() {
   if (mLocationClient != null && mLocationClient.isStarted()) {
     mLocationClient.stop();
   }
   super.onDestroy();
 }
 @Override
 protected void onStop() {
   super.onStop();
   mBaiduMap.setMyLocationEnabled(false);
   mLocationClient.stop();
   myOrientationListener.stop();
 }
예제 #7
0
  @Override
  protected void onDestroy() {
    super.onDestroy();
    JMessageClient.unRegisterEventReceiver(this);

    client.stop();
  }
예제 #8
0
 @Override
 public void onStop() {
   super.onStop();
   if (mLocationClient.isStarted()) {
     mLocationClient.stop();
   }
 }
예제 #9
0
 @Override
 public void onReceiveLocation(BDLocation location) {
   if (location == null) return;
   StringBuffer sb = new StringBuffer(256);
   sb.append("time : ");
   sb.append(location.getTime());
   sb.append("\nerror code : ");
   sb.append(location.getLocType());
   sb.append("\nlatitude : ");
   sb.append(location.getLatitude());
   sb.append("\nlontitude : ");
   sb.append(location.getLongitude());
   sb.append("\nradius : ");
   sb.append(location.getRadius());
   if (location.getLocType() == BDLocation.TypeGpsLocation) {
     sb.append("\nspeed : ");
     sb.append(location.getSpeed());
     sb.append("\nsatellite : ");
     sb.append(location.getSatelliteNumber());
   } else if (location.getLocType() == BDLocation.TypeNetWorkLocation) {
     sb.append("\naddr : ");
     sb.append(location.getAddrStr());
     // location.getCity();
   }
   bdLocation = location;
   locationSuccess.dealWithLocationData(location);
   L.i(sb.toString());
   mLocationClient.stop();
 }
예제 #10
0
 @Override
 public boolean onOptionsItemSelected(MenuItem menuItem) {
   switch (menuItem.getItemId()) {
     case R.id.menu_navi:
       // 启动导航跟踪功能,默认是关闭的
       if (!mLocationClient.isStarted()) {
         mLocationClient.start();
         menuItem.setTitle("关闭导航");
       } else {
         mLocationClient.stop();
         menuItem.setTitle("启动导航");
       }
       break;
     case R.id.menu_vehicle:
       // 启动菜单设置用的activity
       entryMenuVehicle();
       break;
     case R.id.menu_cut:
       if (isCut == false) {
         isCut = true;
         menuItem.setTitle("关闭截图");
       } else {
         isCut = false;
         menuItem.setTitle("启动截图");
       }
       break;
     default:
   }
   return true;
 }
예제 #11
0
 /** 停掉百度定位 */
 public void stopBaiduLBS() {
   if (mLocationClient != null && baiduIsStart) {
     Log.d("DDDS", "SSSSSTART stop():");
     mLocationClient.stop();
     baiduIsStart = false;
   }
 }
예제 #12
0
  @Override
  public void onReceiveLocation(final BDLocation location) {
    if (mLocationClient != null) {
      mLocationClient.stop();
      mLocationClient = null;
    }

    if (location != null) {
      final int locType = location.getLocType();
      if (locType == 61 || locType == 65 || locType == 66 || locType == 161) {
        final double latitude = location.getLatitude();
        final double longitude = location.getLongitude();

        if ((mLatitude != mDefaultX || mLongitude != mDefaultY) && mRoutePlanSearch == null) {
          mRoutePlanSearch = RoutePlanSearch.newInstance();
          mRoutePlanSearch.setOnGetRoutePlanResultListener(this);

          final PlanNode from = PlanNode.withLocation(new LatLng(latitude, longitude));
          final PlanNode to = PlanNode.withLocation(new LatLng(mLatitude, mLongitude));

          final WalkingRoutePlanOption walkingRoutePlanOption = new WalkingRoutePlanOption();
          walkingRoutePlanOption.from(from);
          walkingRoutePlanOption.to(to);

          if (!mRoutePlanSearch.walkingSearch(walkingRoutePlanOption)) mRoutePlanSearch = null;
        }
      }
    }
  }
 public void stop() {
   synchronized (objLock) {
     if (client != null && client.isStarted()) {
       client.stop();
     }
   }
 }
예제 #14
0
 @Override
 protected void onPause() {
   // TODO Auto-generated method stub
   super.onPause();
   mMapView.onPause();
   mLocationClient.stop();
 }
예제 #15
0
 @Override
 protected void onStop() {
   super.onStop();
   if (mLocClient != null) {
     mLocClient.stop();
   }
 }
예제 #16
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   if (mLocationClient != null) {
     mLocationClient.stop();
     mLocationClient = null;
   }
 }
예제 #17
0
 @Override
 public void onReceiveLocation(BDLocation location) {
   OnCompleteLocation(location);
   if (mLocClient != null) {
     mLocClient.stop();
     mLocClient = null;
   }
 }
예제 #18
0
 @Override
 public void onReceiveLocation(BDLocation location) {
   if (!Utils.isEmpty(location.getLatitude() + "")
       && !Utils.isEmpty(location.getLongitude() + "")) {
     mLocationClient.stop();
     tv_address.setText(location.getCity());
   }
 }
예제 #19
0
 @Override
 protected void onDestroy() {
   locationClient.stop();
   map.setMyLocationEnabled(false);
   mapView.onDestroy();
   mapView = null;
   super.onDestroy();
 }
예제 #20
0
  @Override
  protected void onDestroy() {
    super.onDestroy();
    if (mLocationClient != null && mLocationClient.isStarted()) {

      mLocationClient.stop();
    }
  }
 /**
  * *
  *
  * @param option
  * @return isSuccessSetOption
  */
 public boolean setLocationOption(LocationClientOption option) {
   boolean isSuccess = false;
   if (option != null) {
     if (client.isStarted()) client.stop();
     DIYoption = option;
     client.setLocOption(option);
   }
   return isSuccess;
 }
예제 #22
0
 @Override
 protected void onDestroy() {
   super.onDestroy();
   mapView.onDestroy();
   if (client != null) {
     client.stop();
   }
   Log.e("tag", "---------------------finish---------------------------");
 }
예제 #23
0
 @Override
 protected void onStop() {
   // TODO Auto-generated method stub
   super.onStop();
   mapdu.setMyLocationEnabled(false);
   client.stop();
   // 停止方向传感器
   myorientaion.stop();
 }
예제 #24
0
 @Override
 protected void onPause() {
   mMapView.onPause();
   if (mLocClient != null) {
     mLocClient.stop();
   }
   super.onPause();
   lastLocation = null;
 }
예제 #25
0
 public void onDestroy() {
   // 退出时销毁定位
   mLocClient.stop();
   // 关闭定位图层
   mBaiduMap.setMyLocationEnabled(false);
   mMapView.onDestroy();
   mMapView = null;
   super.onDestroy();
 }
예제 #26
0
  @Override
  protected void onStop() {
    ((App) getApplication()).onLocListeners.remove(this);
    if (mLocationClient != null) {
      mLocationClient.stop();
    }

    super.onStop();
  }
예제 #27
0
  @Override
  protected void onPause() {
    Log.v(Constant.TAG, "SetStarPlaceActivity:onPause");
    mapView.onPause();

    // 销毁定位
    mLocationClient.stop();

    super.onPause();
  }
예제 #28
0
 @Override
 protected void onDestroy() {
   mLocClient.stop();
   mBaiduMap.setMyLocationEnabled(false);
   mMapView.onDestroy();
   mMapView = null;
   speechRecognizer.destroy();
   mPoiSearch.destroy();
   super.onDestroy();
 }
예제 #29
0
  @Override
  protected void onDestroy() {
    if (mLocClient != null) mLocClient.stop();
    mMapView.destroy();

    // Gl app = (Gl)this.getApplication();
    if (mBMapManager != null) {
      mBMapManager.destroy();
      mBMapManager = null;
    }
    super.onDestroy();
  }
예제 #30
0
 @Override
 protected void onDestroy() {
   // TODO Auto-generated method stub
   mMapView.destroy();
   if (mMapManager != null) {
     mMapManager.destroy();
     mMapManager = null;
   }
   if (mLocationClient.isStarted()) {
     mLocationClient.stop();
   }
   super.onDestroy();
 }