|
114
|
+ private void startLocation(){
|
|
|
115
|
+ initLocation();
|
|
|
116
|
+ LogHelper.d(TAG,"当前是旅行模式,开始定位");
|
|
|
117
|
+ locationClient.setLocationOption(locationOption);
|
|
|
118
|
+ locationClient.startLocation();
|
|
|
119
|
+ }
|
|
|
120
|
+
|
|
|
121
|
+
|
|
|
122
|
+ private void destroyLocation(){
|
|
|
123
|
+ if (null != locationClient) {
|
|
|
124
|
+ locationClient.stopLocation();
|
|
|
125
|
+ locationClient.onDestroy();
|
|
|
126
|
+ locationClient = null;
|
|
|
127
|
+ locationOption = null;
|
|
|
128
|
+ }
|
|
|
129
|
+ mHandler.removeCallbacksAndMessages(null);
|
|
|
130
|
+ }
|
|
|
131
|
+
|
|
|
132
|
+ @Override
|
|
|
133
|
+ public boolean handleMessage(Message msg) {
|
|
|
134
|
+ if(msg.what == MSG_FETCH_TOUR_INFO){
|
|
|
135
|
+ return true;
|
|
|
136
|
+ }else if(msg.what == MSG_START_LOCATION){
|
|
|
137
|
+ startLocation();
|
|
|
138
|
+ return true;
|
|
|
139
|
+ }
|
|
|
140
|
+ return false;
|
|
|
141
|
+ }
|
|
|
142
|
+}
|