Answer the question
In order to leave comments, you need to log in
How to correctly describe class constructor for values from Firebase?
The code:
class Houses(_costV: String, _locationV: String, _roomsV: String, _squareV: String, _image: String, _infoV: String, _put: String, _date: String, _time: String) {
private var costV: String
private var locationV: String
private var roomsV: String
private var squareV: String
private var image: String
private var infoV: String
private var put: String
private var date: String
private var time: String
init {
costV=_costV
locationV=_locationV
roomsV=_roomsV
squareV=_squareV
image=_image
infoV=_infoV
put=_put
date=_date
time=_time
}
fun getCostV(): String {
return costV
}
fun setCostV(costV: String) {
this.costV = costV
}
fun getLocationV(): String {
return locationV
}
fun setLocationV(locationV: String) {
this.locationV = locationV
}
fun getRoomsV(): String {
return roomsV
}
fun setRoomsV(roomsV: String) {
this.roomsV = roomsV
}
fun getSquareV(): String {
return squareV
}
fun setSquareV(squareV: String) {
this.squareV = squareV
}
fun getImage(): String {
return image
}
fun setImage(image: String?) {
this.image = image!!
}
fun getInfoV(): String {
return infoV
}
fun setInfoV(infoV: String) {
this.infoV = infoV
}
fun getPut(): String {
return put
}
fun setPut(put: String) {
this.put = put
}
fun getDate(): String {
return date
}
fun setDate(date: String) {
this.date = date
}
fun getTime(): String {
return time
}
fun setTime(date: String) {
this.time = date
}
}
com.google.firebase.database.DatabaseException: Class ru.homebuy.neito.Model.Houses does not define a no-argument constructor. If you are using ProGuard, make sure these constructors are not stripped.
Answer the question
In order to leave comments, you need to log in
god, what a mess. Have you looked at the features of Kotlin at least a little?
class Houses(var costV: String, var locationV: String, var roomsV: String, var squareV: String, var image: String, var infoV: String, var put: String, var date: String, var time: String)
does not define a no-argument constructorit is written in black and white
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question