'<html>None of the following functions can be called with the arguments supplied:
I want to do my task, the code from my teacher but mine is always error :
<html>None of the following functions can be called with the arguments supplied:<br/>public constructor Grup(id: Int) defined in com.cika.uasmobiledua.model.Grup<br/>public constructor Grup(name: String, label: String) defined in com.cika.uasmobiledua.model.Grup
Here's my code:
package com.cika.uasmobiledua.model
import com.google.gson.Gson
class Grup {
var id = 0
var name = ""
var label = ""
constructor(id : Int){
this.id = id
}
constructor(name : String, label : String){
this.name = name
this.label = label
}
fun toJson(): String{
return Gson().toJson(this, Grup::class.java)
}
fun fromJson(json : String): Grup{
if (json.isEmpty()) return Grup()
return Gson().fromJson(json, Grup::class.java)
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
