java - Android background music service restart -


my application control music in class extents application using service. background music service called when application starts. , overriding onuserleavehint() stop service.

to prevent music stop across activities, added flag

  intent.addflags(intent.flag_activity_no_user_action); 

so music isn't stopped , works fine. but problem home button.

when push home button, music stopped. , open application music still stopped. because there no call start service, except application oncreate.

that's why want restart service. how can check service started or stopped?

thanks read question!

try start service on onresume or on onstart method.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -