This article applies to the following:
- BlackBerry® wireless devices based on Java™
- BlackBerry Device Software 4.1
The dispatch thread (or main event thread) processes system messages. Blocking this thread prevents system messages from being processed, which leads to a message queue overflow and termination of the application. To prevent it, BlackBerry Device Software 4.1 and later no longer allow an application to initiate a call to a blocking method from the main event thread.
However, if an application attempts to block on the main event thread, an exception is thrown and the Blocking operation not permitted on event dispatch thread statement appears. To resolve this issue, move any blocking operations into their own threads.
Examples of blocking methods are as follows:
readmethod of the
acceptAndOpenmethod of the
doModalmethod of the