【发布时间】:2020-03-02 15:52:53
【问题描述】:
您好,当将相同的值从 if 传递给 else 时出现错误,logcat 没有给我更多信息,只是 E / AndroidRuntime: FATAL EXCEPTION: main,并指向包含 if 和 else 的行。有人可以告诉我如何解决吗?欢迎任何帮助。
override fun onMapReady(googleMap: GoogleMap) {
Log.i("MAP READY", "READY")
LINE ERROR val position = if (currentLocation != null) LatLng(currentLocation!!.latitude, currentLocation!!.longitude) else LatLng(currentLocation!!.latitude, currentLocation!!.longitude)
this.map = googleMap
this.map!!.moveCamera(CameraUpdateFactory.newLatLngZoom(position, 15f)) // Vienna
getFineLocationPermission()
this.map!!.setOnMarkerClickListener(this)
this.map!!.uiSettings.isRotateGesturesEnabled = true
this.map!!.uiSettings.isZoomGesturesEnabled = true
this.map!!.setOnInfoWindowClickListener(this)
this.map!!.setOnMapLongClickListener(this)
}
【问题讨论】:
标签: android android-studio kotlin