Open reymesson1 opened 5 years ago
fun getDataList() : ArrayList
var detailService : DetailService = rest.getDetail()
var call = detailService.getDetail()
val stringList = ArrayList<String>()
call.enqueue(object : Callback<List<Detail>>{
override fun onFailure(call: Call<List<Detail>>, t: Throwable) {
Log.i("error", t.toString())
}
override fun onResponse(call: Call<List<Detail>>, response: Response<List<Detail>>) {
response.body()!!.forEach {
stringList.add(it.name)
}
}
})
return stringList
}
val stringList = ArrayList()