Android ViewModel Tutorial : View Model Introduction : Android Jetpack Architecture #3.1

preview_player
Показать описание

In this video, you will learn about ViewModel, another Architecture component and how it works. You will see how it survives the configuration changes such as screen rotation and is aware of Activity Lifecycle and helps to preserve the data.

.
Please donate and support my work
(If you think my free tutorials are better than paid ones :)

Free Programming courses:

Free Flutter course:

Free Android courses:

More free programming courses:

Check out my website:

Let's get in touch! [Sriyank Siddhartha]

---- Thank you for your love and support ----
Рекомендации по теме
Комментарии
Автор

What is the drawback if we use sharedpreferences to store the data and save the data again when device rotate we can retrieve the data from SP and display?

hamdanali
Автор

U are awesome good explanation and speech

dharmikthakkar
Автор

I have query if destroy is call, activity will destroyed then how the data still in view model View model should be clear ?

jayeshshiray
Автор

Could you distinguish between completely destroy and destroy, Thanks.

seanislam
Автор

As you said the life cycle of ViewModel get destroyed when activity calls on destroy method, but at the same time you are saying that while screen rotation Activity calls on destroy method and again it call on create and data get persist in view model.
Now my question is if my on destroy method is called then how viewmodel is still holding the data while screen rotation.

ABHISHEKKUMAR-modj
Автор

If I rotate screen by implementing vieemodel, will life cycle callbacks will call again or not?

desamnarendrakumarreddy
Автор

Tell me when first time onDestry() method call then why onCleared() method will not call?
Not Clear...

navneekumar
Автор

This will work same so how to differentiate viewmodel

rohitshrivastava
Автор

How does the viewModel knows when the activity is entirely destroyed?

SurazVerma
Автор

I did not understand what are configuration i rotate my device data remains the same in Explain

dharmikthakkar
Автор

Is this same ViewModel of MVVM Pattern?

rabindraacharya
Автор

When the rotate onCreate does not call again e E e e eMANJAI INDIAN

botirkarim