android不知道为什么requestLocationUpdate在我的手机上不起作用
遵循谷歌位置中的简单代码。我使用:android不知道为什么requestLocationUpdate在我的手机上不起作用,android,google-maps,location,Android,Google Maps,Location,遵循谷歌位置中的简单代码。我使用: gmap = ((SupportMapFragment) getSupportFragmentManager() .findFragmentById(R.id.map)).getMap(); gmap.setMyLocationEnabled(true); mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE)
gmap = ((SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map)).getMap();
gmap.setMyLocationEnabled(true);
mLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
3000, 0, this);
在方法位置更改中,我使用Toast来显示消息。在genymotion中,它运行正常,但在我的手机中,RequestLocationUpdate似乎没有运行。嗯,全球定位系统,3G网络。和地图显示,我认为问题不是由API_键,所以什么问题是,我重新启动了手机,但没有任何变化因为您使用的是GPS,很可能您无法看到卫星。您的通知栏中是否有闪烁的GPS图标?如果是这样,那就是问题所在。请注意,您几乎永远无法在建筑物内获得GPS信号,也无法到室外测试或使用模拟位置提供商。哦,上帝。。。。谢谢,现在是凌晨2:30,我想我得等很长时间才能考上: