STWHead Set Manager
STWHeadSetManager
Description :
This class represent the API for all actions/event related to Headset.
This class offers several possible operations defined in the following list :
- Headset plug
- Headset unplug
Example of use :
- Implementation :
private IHeadSetListener mHeadSetListener = new IHeadSetListener() {
public void onHeadSetPlugged() {
//code
}
public void onHeadSetUnplugged() {
// code
}
};
Content copied to clipboard - Registration :
STWHeadSetManager.getInstance().registerForHeadsetManagerEvents(mHeadSetListener);
Content copied to clipboard - Unregister :
STWHeadSetManager.getInstance().unregisterForHeadsetManagerEvents(mHeadSetListener);
Content copied to clipboard
Content copied to clipboard
Functions
Link copied to clipboard
Get or create the single instance of STWHeadSetManager.
Link copied to clipboard
open fun registerForHeadsetManagerEvents(@NonNull headSetListener: IHeadSetListener)
Content copied to clipboard
Register the specified listener to be notified by any Hardware event
Link copied to clipboard
open fun unregisterForHeadsetManagerEvents(@NonNull headSetListener: IHeadSetListener)
Content copied to clipboard
Unregister the specified listener to not receive any Bluetooth events