2 ms·
The solutions presented seem simple enough. Here's the "I must resume my activities immediately!" solution: 1. Pause playback when you receive onPause(). 2. W
by simoncion 15y ago
The solutions presented seem simple enough. Here's the "I must resume my activities immediately!" solution:
1. Pause playback when you receive onPause().
2. When you receive onResume():
2a. If you have previously received an onFocusChanged(false) message, wait for an onFocusChanged(true) message to arrive before resuming playback.
2b. If you have not previously received an onFocusChanged(false) message, then resume audio immediately.
3. Test thoroughly!
The documentation for onFocusChanged might be helpful for you:
http://developer.android.com/reference/android/view/View.OnFocusChangeListener.html http://developer.android.com/reference/android/view/View.OnF...