Is there any way to absolutely prevent an Android app from being restarted the moment it is backgrounded?
I ask because I have an app that uses a good amount of memory, its for users to create media content. Often, if the user leaves the app, even for a moment for example to go check email for 10 seconds, upon reopening it, it has restarted and all (unsaved) progress has been lost.
Saving is something can take upwards of 5 seconds or 5 minutes, depends on the amount of stuff the user is created.
I was thinking if there was a way to get a "dummy" service linked to the app. Would the existence of a running service (one of those permanent notifications in the dropdown notifications list) prevent the app itself from clearing memory/restarting when backgrounded? Is there a certain acceptable practice regarding this?
question from:
https://stackoverflow.com/questions/66052539/prevent-android-application-from-being-restarted 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…