Parcelable can to be used to save the state of the app on screen rotation ? This can also be done by Using Loaders ? I was wondering if there is a difference between the two ?. I am new to android programming . Sorry if this is too trivial
Asked
Active
Viewed 56 times
2 Answers
0
Loaders will help you with configuration changes such as screen rotation. I am infering you want to save your activity state onPause() and then get it back in onSavedInstance, but this is not safe as this is not safe as there is not guaranteed onSavedInstance is called. You can use loaders but a better approach is to use RxJava.

HaroldSer
- 2,025
- 2
- 12
- 23
0
You can use the ViewModel class along with LiveData. You could also use an observer to monitor for changes.ViewModel is one of the new architecture components for Android.

Bissi singh
- 50
- 1
- 11