Tell me how you can track and pause the service from your application, which uses signal transmission to the speaker (that is, for example, plays some audio file, and in my application I plan to use the speaker and that microphone. Through the ActivityManager I can get list of all running services:

ActivityManager am = (ActivityManager) this.getSystemService(ACTIVITY_CERVICE); List<ActivityManager.RunningServiceInfo> rs = am.getRunningService(50); 

but how to get the one from this list and suspend its work. Or is another approach needed?

  • at least what you are making, it is also possible to do another kanesh, but I think you need the standard principle of capturing audiofocus. developer.android.com/guide/topics/media-apps/audio-focus You need to reformulate the question and explain now it is impossible to answer - Shwarz Andrei
  • Thank you, I just did not know about audiofocus - cosmic_M

0