private void init() { ci = CommonInfo.getInstance(); option.setOpenGps(true); // 打开gps option.setCoorType("bd09ll"); // 设置坐标类型 option.setScanSpan(60000); mLocClient.registerLocationListener(myListener); mLocClient.setLocOption(option); mLocClient.start(); }
/** 开始定位服务, activity的onResume中设置监听,用于回调 */ public void startLocatingActive(OnLocationUpdateListener loclistener, int wait) { ci = CommonInfo.getInstance(); option.setOpenGps(true); // 打开gps option.setCoorType("bd09ll"); // 设置坐标类型 option.setScanSpan(wait); mLocClient.registerLocationListener(myListener); mLocClient.setLocOption(option); mLocClient.start(); mLocClient.requestLocation(); LocListener = loclistener; }
public LocationData getLocation() { ci = CommonInfo.getInstance(); return ci.myLoc; }
public void saveLocation() { ci = CommonInfo.getInstance(); // ci.persist(); }