A
A
AnteFil2021-02-15 11:56:14
android studio
AnteFil, 2021-02-15 11:56:14

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)

There is an interface in which
interface ApiService {
    @GET("users")
    fun fetchAllusers():Call<List<User>>
}

as a result, when I write further in MainActivity, it
api.fetchAllusers().enqueue()
underlines the type of error in red. How to fix it? And how to display the result, for example, in the studio console?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2021-02-15
@sergey-gornostaev

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 question

Ask a Question

731 491 924 answers to any question