A Simple View Of ViewModels
<p>While building applications, many of you developers have probably encountered the problem of losing your application’s data when you rotate your device. Ever wondered why that happens? Well, it’s because your activity is recreated when there is a configuration change, And when your activity is recreated, your data or state is lost. But fear not, ViewModels are here to the rescue!</p>
<p>ViewModels are not exclusive to Android applications, but they have a special place on Android.</p>
<h2>Prerequisites</h2>
<ul>
<li>Basics of Android Development.</li>
<li>Understanding of Kotlin.</li>
<li>Knowledge of LiveData and DataBinding.</li>
<li>Knowledge of Activity Lifecycle.</li>
</ul>
<h1>What is application architecture?</h1>
<p>Before we move on to <strong>ViewModels</strong>, let’s learn a little about app architecture.</p>
<p><a href="https://medium.com/@yadavshashank700/a-simple-view-of-viewmodels-61c249d1bd6f">Visit Now</a></p>