I found a case when architecture components ViewModel isn\'t retained - in short it goes as follows:
ViewModel
Change support library/compileSDK/targetSDK to 28.
I had similar issue with multi-window. When switching to split screen, my viewModel is recreated. Support library 28 fixed my problem. (My lifecycle version is 1.1.1)