In MVVM, network calls should be placed in a:
- Layout XML
- Activity's onCreate only
- Repository used by a ViewModel
- BroadcastReceiver
Answer
C) Repository used by a ViewModel
Repository + ViewModel separates data access from UI and survives rotation.
Computer Science MCQ · More Maps and Consuming Web Services over HTTP MCQs · Practise