MIDlet device availability events are sent through the javax.microedition.media.PlayerListener
interface.
The device sends the DEVICE_UNAVAILABLE
state event to
the registered PlayerListeners
when a player becomes
unavailable, and DEVICE_AVAILABLE
state event when the
device is again available. The player will be in the realized state when it
becomes available, so the MIDlet will not need to call the realize
method
before restarting the sound.
Note: When a voice call interrupts the MMAPI MIDlet use, Series 40 devices
send the DEVICE_UNAVAILABLE
event. In S60 3rd Edition
and later, when there is incoming call, all the players in STARTED state are
stopped (they go to PREFETCHED state). The PlayerListener
is
also notified with the PlayerListener.STOPPED
event. Player
s
are not automatically restarted when call ends.