Why is the API method declared with suspend?
- To cache data
- To run it twice
- So it can be called from a coroutine and run without blocking the main thread
- To make it private
Answer
C) So it can be called from a coroutine and run without blocking the main thread
Retrofit runs suspend functions off the main thread.
Computer Science MCQ · More Lab: Displaying Data from an API MCQs · Practise