Possible duplicate:Android: test headphone connection
Is there a way to check if the headphones are connected to an Android device? Some kind of audio routing property or something else?
You want to set up your BroadcastReceiver by looking for the intent "ACTION_HEADSET_PLUG".
https://developer.android.com/reference/android/content/Intent.html#ACTION_HEADSET_PLUG
Source: https://habr.com/ru/post/1746414/More articles:Django - Form Validation Error - djangojQuery way to handle select lists, radio buttons and checkboxes - javascriptDeriving from a component and implementing IDisposable properly - c #Changing a hidden file in Java - javaJavaScript BubbleSort, how to increase its efficiency? - javascriptМожно ли создавать HTTP-запросы с помощью MATLAB? - httprequestSelect the i-th smallest element from the array - javaФайлы cx_Freeze и PYC/PYD - pythonHow to configure a report server instance? - sqlIs there a way to get a float from the parameters of the varargs function? - cAll Articles