Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/227.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android不知道为什么requestLocationUpdate在我的手机上不起作用_Android_Google Maps_Location - Fatal编程技术网

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,我想我得等很长时间才能考上: