Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
157 views
in Technique[技术] by (71.8m points)

Prevent Android application from being restarted?

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...