I'm wanting to make it so if headphones are plugged in the device something happens such as a notification icon appears. (I already have the notification icon stuff done) But I can't seem to find a way to make it happen. I'm wanting something like this
if headphones_plugged_in {
do this
}
I found this online
AudioManager.isWiredHeadsetOn()
I just don't know how I would use that. I already added the right permissions in the manifest too! If you could guide me or link me to something it would be great. Thank You!