Featured classes and interfaces


This interface allows a MIDlet to enable and disable media player mode at runtime. When media player mode is enabled, media key-press events are consumed by that application and not posted to applications running in the background. If more than one application has media player mode enabled, then the application running in the foreground will receive the events. If all applications with this mode enabled are running in the background, then the application that was running in the foreground most recently will receive the events. A MIDlet enables media player mode by invoking MediaBehaviourControl.setMediaPlayerModeEnabled().


An application processes media key-press events using the keyPressed(), keyReleased(), and keyRepeated() methods in the Canvas class. The MediaBehaviourControl generates media key-press events even while the MIDlet is running in the background.

An application determines which key was pressed by examining the keyCode parameter. For more information about keyCode values that are used by the Canvas class, see the API reference for the BlackBerry® Java® Development Environment.

Previous topic: Overview

Was this information helpful? Send us your comments.