|
|
@@ -11,8 +11,6 @@ import android.location.LocationListener;
|
|
|
import android.location.LocationManager;
|
|
|
import android.location.LocationProvider;
|
|
|
import android.os.Bundle;
|
|
|
-import android.os.Handler;
|
|
|
-import android.os.Looper;
|
|
|
import android.support.v4.app.ActivityCompat;
|
|
|
import android.text.TextUtils;
|
|
|
import android.util.Log;
|
|
|
@@ -256,27 +254,27 @@ public class NativeLocationManager implements BaseLocationManager {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 由于google收费,必须限制每天使用量
|
|
|
- * 流程:
|
|
|
- * 1.第一次进入直接进行搜索
|
|
|
- */
|
|
|
- private String lastKey;
|
|
|
- private boolean isWhating, isResulting = false;
|
|
|
- private Handler mWhatHandler = new Handler(Looper.getMainLooper());
|
|
|
-
|
|
|
- private void startWhat(final Context ct, final OnSearchLocationListener mOnSearchLocationListener) {
|
|
|
- if (!isWhating) {
|
|
|
- isWhating = true;
|
|
|
- mWhatHandler.postAtTime(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- isWhating = false;
|
|
|
- loadByInput(ct, null, lastKey, mOnSearchLocationListener);
|
|
|
- }
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 由于google收费,必须限制每天使用量
|
|
|
+// * 流程:
|
|
|
+// * 1.第一次进入直接进行搜索
|
|
|
+// */
|
|
|
+// private String lastKey;
|
|
|
+// private boolean isWhating, isResulting = false;
|
|
|
+// private Handler mWhatHandler = new Handler(Looper.getMainLooper());
|
|
|
+//
|
|
|
+// private void startWhat(final Context ct, final OnSearchLocationListener mOnSearchLocationListener) {
|
|
|
+// if (!isWhating) {
|
|
|
+// isWhating = true;
|
|
|
+// mWhatHandler.postAtTime(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// isWhating = false;
|
|
|
+// loadByInput(ct, null, lastKey, mOnSearchLocationListener);
|
|
|
+// }
|
|
|
+// }, 1000);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
/**
|
|
|
* 通过输入进行搜索
|
|
|
@@ -289,13 +287,12 @@ public class NativeLocationManager implements BaseLocationManager {
|
|
|
public void loadByInput(Context ct, String city, String keyWord, final OnSearchLocationListener mOnSearchLocationListener) {
|
|
|
if (ct == null || mOnSearchLocationListener == null)
|
|
|
return;
|
|
|
-
|
|
|
- this.lastKey = keyWord;
|
|
|
- if (isWhating || isResulting) {
|
|
|
- startWhat(ct, mOnSearchLocationListener);
|
|
|
- return;
|
|
|
- }
|
|
|
- isResulting = true;
|
|
|
+// this.lastKey = keyWord;
|
|
|
+// if (isWhating || isResulting) {
|
|
|
+// startWhat(ct, mOnSearchLocationListener);
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// isResulting = true;
|
|
|
HttpClient.Builder requestBuilder = new HttpClient.Builder()
|
|
|
.isDebug(true)
|
|
|
.url("textsearch/json")
|
|
|
@@ -319,7 +316,7 @@ public class NativeLocationManager implements BaseLocationManager {
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
} finally {
|
|
|
- isResulting = false;
|
|
|
+// isResulting = false;
|
|
|
}
|
|
|
}
|
|
|
|