android - Droid Incredible Headphones Detection -


i'm developing android application droid incredible. when plug in headphones, icon appears on status bar, presume phone must know headphones present.

my code produces beeps in response various user inputs, discovered today that's bad idea when user wearing headphones. ow.

does have suggestions how can detect presence of headphones programmatically, in android??

thanks, r.

i found audiomanager class on developer site, looks have helpful method this, have not tested it:

audiomanager = getsystemservice(context.audio_service); bool headsetenabled = am.iswiredheadseton(); 

Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -