Closed abiemann closed 5 years ago
oh I see now... the library generates the onSaveInstanceState() and onRestoreInstanceState(). Unfortunately, onSaveInstanceState() is unreliable - it's not always triggered, but is typically triggered on phone rotations. I need it more reliable... I need the data saved whenever onPause() is called. Right now, a person can press the HOME button, close the app in the list of apps, and the typed-in data is not saved
Thanks for your suggestion! And yes I wrote this lib to help app data survive on orientation change and situation that app is killed by system unexpectedly when it is brought to background. It isn't a data persistent library by design. But I think your suggestion is interesting, I'm considering to add this functionality to later versions, thanks :)
After consideration, I think SaveState is only a simple tool, and adding data persistent function to it would make it a little complex, so temporary I am not planning to change it. If more guys ask me for this feature then reopening this issue is ok.
my implementation below doesn't work. I collect all the data in onPause() but when I leave the app, close it, and relaunch it then the data isn't loaded. When is the data saved ?