我正在制作一个超级克隆应用程序
这是我的代码,它会检查是否有任何驱动器处于活动状态,如果有,它会更新骑手位置
if (driverActive != false) {
LatLng userLocation = new LatLng(location.getLatitude(), location.getLongitude());
mMap.clear();
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(userLocation, 20));
mMap.addMarker(new MarkerOptions().position(userLocation).title("Your Location"));
}
android studio 显示警告 driverActive != false' 可以简化为 'driverActive' 并且不会更新骑手地图
但是如果我删除 driverActive if 语句,它会起作用并更新骑手的位置......
任何帮助,将不胜感激
HUX布斯
相关分类