Closed AICT20 closed 4 months ago
Hello @AICT20 , thanks for the hint! I read the documentation Fragment and View CREATED. I think the solution is to do isUnlocked = false
at the end of onSaveInstanceState()
. I don't know if this is necessary but I still do that at onStop()
if API Level < 28.
I notice that in 'MainActivity', both 'onStop' and 'onSaveInstanceState' use the field 'isunlock'. However, accoding to the Android official documents, the execution order of these two lifecycle callbacks may reverse after Android API 28. In this case, if users use devices at or over API 28, 'isunlock' is always set to false in 'onStop' and afterwards saved into the bundle in 'onSaveInstanceState'.