I\'m trying to pause media player when the phone rings. I use the sample code from android site. It\'s like this;
public void onAudioFocusChange(int focusCha
Two things to check: 1) Do you have a play button for instance, that when clicked, requests focus and starts playback? I had a problem once that they played a "tick" sound to provide feedback of a click. They would take audio focus away from my app when that happened. In your XML set this value to false for all your buttons in that activity:
android:soundEffectsEnabled = 'false'
2) Check for the installation of other media player apps that also request focus. Are they requesting focus right after losing it? If so there's not much you can do about this other than warn your users not to install this app.