Can you help with restore app after minimize?

Hi guys,

I have a problem with Ionic 3 after migrate our app from android 8 to android 9 and the “issue” is the application after we restore the application, after is minimized (circle button, settings bar above screen, etc ), the data status is reset to when app is openned for first time this day.
I checked this issue in stack over flow, this forum i didn’t see nothing that can helps me.

This only happens with android 9, have i modify anything more in AndroidManifest or something like that to evade this?

Regards,

Samuel

I’m not aware of “the data status” as being anything consistently managed by Ionic or Angular, so I’m assuming you’re referring to business level data in your app. You’re responsible for managing this - if you need to, you can consider using something like Ionic Storage to manage “hibernation” by writing state information in a pause handler and reading it back in resume.

You can’t rely on anything else, because your app may have been reaped in order to deal with a device-wide resource shortage.

You’re responsible for managing this - if you need to, you can consider using something like Ionic Storage to manage “hibernation” by writing state information in a pause handler and reading it back in resume .

it’s strange, i had not to manage nothing with android 8. So are you saying that in the “homepage” or “indexpage” i should enable this new logic for pause (saving data to storage) and resume for restore the data to db?

You may not have ever noticed it before, but pause and resume have been in the Android API since version 1.

I would absolutely not do any of this in pages. I would do it in a singleton service. Pages should be blissfully unaware of business data lifecycle.

Thank you for your responses, you are guiding me through something totally new for me.

You may not have ever noticed it before, but pause and resume have been in the Android API since version 1.

I understand that this option was there till version 1, but… how is it possible that NOW, with new android version have i to handle this? I’m so confused… I think that always should happens, without taking into account android version… I don’t know the reason, just… if i have to change it, i’m going to change it.

:confused: :confused: :confused:

Thanks a lot for your responses and your time

Regards,

Samuel

One more thing… this application is running on android 10 devices. Application is develop ionic + cordova, is it possible that this casuistic “android 10 + apk android 9” generates any problem?

Regards,

Samuel