…ion lifecycle. This is different from an Activity context, whi…ion lifecycle. This is different from an Activity context, which is tied to the Activity lifecycle. In fact, if you need an Application context, you should extend AndroidViewModel which is simply a ViewModel that includes an Application reference.
ViewModels should not, though, hold a reference to Activities, Fragments, or Contexts.** Furthermore, ViewModels should not contain elements that contain references to UI controllers, such as Views, since this will create an indirect reference to a Context.