开发者

Android earphone jack [duplicate]

开发者 https://www.devze.com 2022-12-31 05:37 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Android: Checking if headphones are plugged in
This question already has answers here: Closed 12 years ago.

Possible Duplicate:

Android: Checking if headphones are plugged in

Is there a way to check if earphones are connected to the Android开发者_如何学运维 device? Some kind of audio routing property or something?


You'll want to set up a BroadcastReceiver, looking for the "ACTION_HEADSET_PLUG" Intent.

https://developer.android.com/reference/android/content/Intent.html#ACTION_HEADSET_PLUG

0

精彩评论

暂无评论...
验证码 换一张
取 消