问题
At app launch, is it possible to detect if the device's audio player or another app is currently playing music?
回答1:
You can use the AudioManager to achieve this with it's IsMusicActive property:
AudioManager manager = (AudioManager)Android.App.Application.Context.GetSystemService (Android.Content.Context.AudioService);
var audioDetails = "Audio is " + (manager.IsMusicActive ? "on" : "off");
来源:https://stackoverflow.com/questions/32833722/xamarin-android-detect-if-audio-is-currently-playing-on-device