Answer the question
In order to leave comments, you need to log in
Ending Android application due to lack of resources?
Created a simple Android audio player in Android Studio that plays mp3 files from a remote server.
The app can run in the background.
My Activity also starts a Service, which is displayed in Notifications as a layout with a Play/Stop button.
Everything works in the background without problems until I start using other applications actively (I open several new applications at once, load data into them, etc.). As a result, after some time, my application ends, and the OnDestory event of the Activity is not called.
The RAM size in my device is 1G.
I suspect that the system is killing my application due to lack of resources.
If this is the problem, then how to solve it? How to prevent the system from killing my application when there are not enough resources?
Answer the question
In order to leave comments, you need to log in
То что активити убивается - вполне нормально. onDestroy не гарантирован. В сервисе делай startForeground.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question