C
C
cfmm2016-10-04 14:14:12
Android
cfmm, 2016-10-04 14:14:12

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

2 answer(s)
Денис Загаевский, 2016-10-04
@zagayevskiy Куратор тега Android

То что активити убивается - вполне нормально. onDestroy не гарантирован. В сервисе делай startForeground.

A
afna, 2016-10-04
@sulik93

Посмотреть бы логи

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question