lifecycleScope.launch is used because:
- It needs no internet
- The coroutine is cancelled automatically when the activity is destroyed
- It replaces the adapter
- It runs on a different phone
Answer
B) The coroutine is cancelled automatically when the activity is destroyed
lifecycleScope is bound to the activity's lifecycle.
Computer Science MCQ · More Lab: Displaying Data from an API MCQs · Practise