Coroutines started in viewModelScope are cancelled when:
- The user scrolls
- The screen rotates
- The phone sleeps
- The ViewModel is cleared
Answer
D) The ViewModel is cleared
viewModelScope survives rotation and is cancelled in onCleared.
Computer Science MCQ · More Threading and Publishing Android Applications MCQs · Practise