Alternative to the deprecated AudioManager.isWiredHeadsetOn?

后端 未结 6 1461
暗喜
暗喜 2021-02-13 20:47

The method AudioManager.isWiredHeadsetOn() is deprecated from api level 14, how do we now detect if a wired headset is connected?

6条回答
  •  离开以前
    2021-02-13 21:09

    The documentation's deprecation message states:

    Use only to check is a headset is connected or not.

    So I guess it is okay to keep using it to check whether or not a wired headset is connected, but not to check whether or not audio is being routed to it or played over it.

提交回复
热议问题