In MVVM, network calls should be placed in a:

  1. Layout XML
  2. Activity's onCreate only
  3. Repository used by a ViewModel
  4. 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