I want to check whether heaset is plugged in or not... I did it like this
AudioManager am = (AudioManager)getSystemService(AUDIO_SERVICE);
Log.i("am.isWiredHeadsetOn()", am.isWiredHeadsetOn()+"");
But i am always getting false value...
Why is this happening?
It looks like this is a bug. You will always get
false
when callingisWiredHeadsetOn
unless your addMODIFY_AUDIO_SETTINGS
permission toAndroidManifest.xml
: