A
A
Alexey Medvedev2015-10-24 20:03:19
Android
Alexey Medvedev, 2015-10-24 20:03:19

How to disable the service when the application is minimized?

There is background music in the game. Implemented by the service.

<service android:enabled="true" android:name=".MyService" />

onBackPressed stops the music, but when the application is minimized (by pressing the home button), the service continues to work. How to track folding? Or is there some other method to be used?
Also, there is another related problem with this. If I minimize and then unload the application by holding the "Home" button, the service starts working again after 5-10 seconds, and the process can be completely killed only through the "Application Manager".

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2015-10-24
@RockBearLTD

Activity onUserInteraction()
Service START_NOT_STICKY

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question