许多人可能都知道,Android有很多卷流,例如:
STREAM_ALARM The audio stream for alarms
STREAM_DTMF The audio stream for DTMF Tones
STREAM_MUSIC The audio stream for music playback
STREAM_NOTIFICATION The audio stream for notifications
STREAM_RING The audio stream for the phone ring
STREAM_SYSTEM The audio stream for system sounds
STREAM_VOICE_CALL The audio stream for phone calls
我想知道当前正在使用哪个卷流。我尝试在Audio Manager类中使用getMode()方法,但它返回不相关的信息。
答案 0 :(得分:1)
Register a receiver for action : android.media.VOLUME_CHANGED_ACTION
and check for extra value of "EXTRA_VOLUME_STREAM_TYPE" in onReceive