Android 4.3 isProviderEnabled在Genymotion中的错误结果

Android 4.3 isProviderEnabled wrong result in Genymotion

Genymotion 总是说 "GPS open"。(版本:4.3)。但是 GPS 处于非活动状态。

但我的手机(不是模拟器)android 6 和 5 return 真实结果。

LocationManager locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
        if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)){
            Toast.makeText(this, "GPS open", Toast.LENGTH_SHORT).show();
        }else{
            Toast.makeText(this, "GPS closed", Toast.LENGTH_SHORT).show();
        }

由于屏幕右侧的 GPS 小部件,您可以选择 Genymotion 模拟器的 GPS 位置。

Genymotion 不会将 GPS 位置插入您计算机的位置。

Pro tip: GPS,bluetooth function is not work good with emulator,just check with real devce, If real device gives good result then you are good to go