My app restarts from splash when woken from background

Hi,
My app restarts from splash when woken from background.
I see this issue when app is in background mode for about 3 ~ 5 mins.
I have read articles that Android or iOS can kill apps when resources are needed, but other apps don’t restart.
Do you have any idea why?

Thanks

Well the OS frees resources if they are needed. So if your app is idle or low priority it will get cleared so that other apps can use the resources. This is especially prominent on lower budget phones where resources are scarce.

But most apps never restart when woken from background.

It is quite interesting. Have you tried testing you app on various types of devices to try and replicate the problem?

I’m sorry that I didn’t.
I think that I don’t need to do it.
Because other apps work well on the same device.

Well I have no idea how to replicate the problem, or what might be the couse for it.

i’ve found out that android kills my ionic app, iOS doesn’t. I guess there is something to set for keeping an app alive because i’ve tried other commercial apps and some of them stay alive even if kept in background for a long time. iOS instead, always keeps my apps alive.

I’m reading about android:launchMode, in my app it was “singleTask”, now i’m trying “singleIstance”

let’s see if this works.

android:launchMode=“singleInstance” works fine