上代码吧。。。
//读取当前坐标 final LocationClient mLocationClient = new LocationClient(mActivity); mLocationClient.setLocOption(GPSUtil.GetOnceOption()); mLocationClient.registerLocationListener( new BDLocationListener() { @Override public void onReceiveLocation(BDLocation location) { // TODO Auto-generated method stub if(location!=null){ longitude=location.getLongitude(); latitude=location.getLatitude(); } //这里是你取得经纬度后执行的业务逻辑操作 //.... //几秒钟之后自动停止获取gps new Handler().postDelayed(new Runnable() { @Override public void run() { mLocationClient.stop(); // PromptUtil.showLongToast(mActivity, Longitude+""); } }, 1*1000); } } ); mLocationClient.start(); if (mLocationClient != null && mLocationClient.isStarted()) mLocationClient.requestLocation();