如何检查GPS是否正在读取信号。我已经写了一个代码来检查GPS是否启用。
private void systemService() {
locMgr = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
if(!locMgr.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
AlertDialog.Builder noGps = new AlertDialog.Builder(this);
noGps.setMessage("GPS is off. Please turn it on and restart your Application.");
noGps.show();
}// end of if
}// end of systemsService();但是,即使启用它,GPS传感器也需要几分钟或几秒钟才能接收到信号。
我的问题是:如何检查GPS传感器当前是否正在接收信号?
发布于 2012-02-23 18:33:12
据我所知,你不能。你可以使用runOnFirstFix来使用可用的位置数据,还可以使用requestLocationUpdates定义更新间隔。
https://stackoverflow.com/questions/9411037
复制相似问题