兄弟,找到原因了.http://stackoverflow.com/questions/7518468/phonegap-gps-without-internet再看看phonegap的官方文档:http://docs.phonegap.com/en/1.8.1/cordova_geolocation_geolocation.md.html#geolocationOptions最下面的确有这个说明.所以,只要把
navigator.geolocation.getCurrentPosition(onSuccess, onError);
改成
navigator.geolocation.getCurrentPosition(onSuccess, onError, { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true });
就行了,如果有错误,会提示错误 .
navigator.geolocation.getCurrentPosition(onSuccess, onError);
改成
navigator.geolocation.getCurrentPosition(onSuccess, onError, { maximumAge: 3000, timeout: 5000, enableHighAccuracy: true });
就行了,如果有错误,会提示错误 .
解决方案 »
- android开发 怎样调用淘宝网API获得数据
- android socket通信 UDP视频流 播放
- 关于Tabhost布局可以滚动的问题?
- 在surfaceView上绘制一个运动的小球,感觉是卡卡的。是什么问题?
- nexus one 驱动
- 求助Android NDK: this system lacks kernel support for PPP.
- 刚接触android,麻烦看看为什么这布局会报错!
- Android初学者,做一个什么APP可以将Android大部分知识都用上?
- 使用mediacodec出现的问题
- 如何将一个PNG格式的恶意安卓程序转化为APK文件
- GridView item的显示问题!
- Android intent 传递对象引用问题
还有想问一下模拟器上可以吗
但是真机上面出现了the last location provider was disabled
http://dev.10086.cn/ude/template-detail-49.do