On the Code bar ...
//Read current coordinatesFinal Locationclient mlocationclient =Newlocationclient (mactivity); Mlocationclient.setlocoption (Gpsutil.getonceoption ()); Mlocationclient.registerlocationlistener (NewBdlocationlistener () {@Override Public voidonreceivelocation (bdlocation location) {//TODO auto-generated Method Stub if(location!=NULL) {Longitude=Location.getlongitude (); Latitude=Location.getlatitude (); }//Here is the business logic operation that you performed after you obtained the latitude and longitude//.... //automatically stops acquiring GPS after a few seconds NewHandler (). postdelayed (NewRunnable () {@Override Public voidrun () {mlocationclient.stop ();//promptutil.showlongtoast (mactivity, longitude+ ""); } }, 1* +); } } ); Mlocationclient.start (); if(Mlocationclient! =NULL&&mlocationclient.isstarted ()) mlocationclient.requestlocation ();
About Android Baidu Map call, only call once the solution, the notification bar is not always search GPS ...