본문 바로가기
프로그래밍 놀이터/안드로이드, Java

[android] earphone(headset) plug or unplug intent action

by 돼지왕 왕돼지 2018. 1. 22.
반응형

 [android] earphone(headset) plug or unplug intent action


https://developer.android.com/reference/android/media/AudioManager.html#ACTION_HEADSET_PLUG

action_headset_plug, autiomanager, dynamic receiver, earphone plug intent, earphone unplug intent, headset, headset type, intent extra, manifest, Microphone, Name, Plugged, state, static receiver, Unplugged, [android] earphone plug or unplug intent action

-

Action 은 AudioMangaer.ACTION_HEADSET_PLUG.


intent extra 로 아래 값들이 있다.

"state"

0 : unplugged

1 : plugged


"name"

headset type, human readable string


"microphone"

0 : microphone 기능이 없음

1 : microphone 기능이 함께 있음



-

manifest 를 통해서 receiver 등록되지 않는다.

앱에서 명시적으로 등록해야 한다.




반응형

댓글