0
Companywebclient.kt
fun find(cnpj: String,
success: (company: Company) -> Unit,
failure: (throwable: Throwable) -> Unit,
finished: () -> Unit) {
val call = retrofit.companyService().find(cnpj, 1)
call.enqueue(callback(retrofit,
{
it?.body()?.let(success)
finished()
},
{
it?.let(failure)
finished()
}))
}
Configactivity.java
CompanyWebClient webclient = new CompanyWebClient();
webclient.find(edCnpj.getText().toString(),
company -> {
return Company -> company;
},
{
cnpj_Error = this.message
},
{
closeProgress
}
);
how can I make the Success return?
thank you, helped a lot in understanding
– wwwjsw