Sign in Go Pro

Android Architecture Components - A Deep Dive

What is the AndroidViewModel

This lesson is for PRO members.

Upgrade today to get access to all the PRO lessons.

Unlock this lesson
Autoplay

Up next

Previous

About

The AndroidViewModel class is a subclass of ViewModel and similar to them, they are designed to store and manage UI-related data are responsible to prepare & provide data for UI and automatically allow data to survive configuration change.

The only difference with AndroidViewModel is it comes with the application context, which is helpful if you require context to get a system service or have a similar requirement.

In this lesson, we will see how to use AndroidViewModel to show a list of "Saved WiFi networks" using the WiFiManager system service which requires context.

Comments

There are no comments on this lesson, start the conversation below ...

>
You need to go PRO to post comments.

Lessons in Android Architecture Components - A Deep Dive