如何检查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传感器当前是否正在接收信号?