HI there
I have a music player that does cut out when phone calls received but not when other apps like a sat nav gives instructions.
Ive been told that ive got to have something called "duck" in it and was given this below.
I have a file manager on my phone. Could someone tell me where I am supposed to put the code I.E in the music player files or in the sat nav files.
Thanks
OnAudioFocusChangeListener afChangeListener = new OnAudioFocusChangeListener() {
public void onAudioFocusChange(int focusChange) {
if (focusChange == AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) {
// Lower the volume
} else if (focusChange == AudioManager.AUDIOFOCUS_GAIN) {
// Raise it back to normal
}
}
};
I have a music player that does cut out when phone calls received but not when other apps like a sat nav gives instructions.
Ive been told that ive got to have something called "duck" in it and was given this below.
I have a file manager on my phone. Could someone tell me where I am supposed to put the code I.E in the music player files or in the sat nav files.
Thanks
OnAudioFocusChangeListener afChangeListener = new OnAudioFocusChangeListener() {
public void onAudioFocusChange(int focusChange) {
if (focusChange == AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK) {
// Lower the volume
} else if (focusChange == AudioManager.AUDIOFOCUS_GAIN) {
// Raise it back to normal
}
}
};