need this permission:
<uses-permission android:name="android.permission.BLUETOOTH"></uses-permission>
and code snap:
AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE);
if (audioManager.isWiredHeadsetOn()
|| audioManager.isBluetoothA2dpOn()
|| audioManager.isBluetoothScoOn() ) {
// headset connected
}
Subscribe to:
Post Comments (Atom)
Enable HP Zbook Thunderbolt 3 Dock on Ubuntu
As mention in previously post, I installed Ubuntu on my HP ZBook. After two days used all things work just fine, but the Thunderbolt 3 Dock ...
-
As mention in previously post, I installed Ubuntu on my HP ZBook. After two days used all things work just fine, but the Thunderbolt 3 Dock ...
-
Meet a thrift compiling failure on my project on Windows 7. Using Maven in IntelliJ so I choiced maven-thrift-pluging for thrift files. For ...
-
To create a button in Android app like this: The layout XML: <Button android:layout_width="match_parent" andro...
No comments:
Post a Comment