My activity contains one imageview and a button, when button is clicked the image inside the imageview is changed (works fine).
But when screen orientation changes the image inside imageview is lost (because activity is recreated).
I read in some post that ViewModel survives orientation and it can store large amount of data (bitmap) as compared to onSaveInstanceState.
There are many others options to retreive the same image, but i want to use ViewModel to get that same image without getting affected by orientation change.
So, How can i get the same image using ViewModel?
Thankyou.