鉴于此代码如果Android设备没有GPS作为位置提供商,会发生什么
if (!locator.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
//consider forcing user to turn on gps here
} else {
provider = LocationManager.GPS_PROVIDER;
}
如果设备没有GPS会发生什么。现在,如果没有启用该提供程序,那么我将跳转用户的系统设置以将其打开。但如果不存在呢?如何处理。我不想将这些用户锁定在应用程序之外。
你有没有写一个测试,看看自己? – jsmith