Answer the question
In order to leave comments, you need to log in
Android Studio: How to output the result to the console?
I'm making a request to the site's api. In MainActivity I wrote like this
val retrofit = Retrofit.Builder()
.baseUrl("https://jsonplaceholder.typicode.com/")
.addConverterFactory(GsonConverterFactory.create())
.build()
val api = retrofit.create(ApiService::class.java)
interface ApiService {
@GET("users")
fun fetchAllusers():Call<List<User>>
}
api.fetchAllusers().enqueue()
Answer the question
In order to leave comments, you need to log in
Learn to use the IDE at least enough to be able to see the reason for the underlining in red. Then it will be clear what to fix.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question