Android Viewmodel Savedstatehandle
This is more of a conceptual question. Android recently introduced the concept of handling the state during process death inside viewModel rather than savedInstanceState which pre
Solution 1:
- Enable `Don't keep activities'
- Launch your app
- Tap the home button
- Your app will be killed immediately (
Activity.onDestroy
called)
Solution 2:
Below Steps helps in testing the intelligence of View Model Saved State Library
Step1: After completing the source code changes, build and run the APP.
Step2: Ensure UI of Activity/Fragment has data populated in it.
Step3: Move the App to background by clicking Home Button.
Step4: Now Open the Logcat Tool window and Terminate the APP.
Step5: Relaunch the APP from the Device or Emulator.
Step6: You should see all the data pre-populated in UI.
Post a Comment for "Android Viewmodel Savedstatehandle"