Spotted a bug? Have a great idea? Help us make google.dev great! Submit feedback google.dev Return to playlist To avoid losing data during a device-configuration change, you should save app data in which class? ViewModel LiveData Activity Fragment Which of these statements is true? A ViewModel should never contain any references to fragments, activities, or views. A ViewModel can contain references to fragments, activities, or views. When is a ViewModel destroyed? In an orientation change. When the associated UI controller is destroyed and recreated during a device-orientation change. When the user presses the Back button. When the associated UI controller is finished (if it's an activity) or detached (if it's a fragment). What is the ViewModelFactory interface used for? Receiving notifications when the app data is changed. Instantiating a ViewModel object. Refreshing the data being displayed on the screen. Retaining data during orientation changes.` Submit answers error_outline An error occurred when grading the quiz. Try again later.