blackberry-webworks/WebWorks — comment on commit 2cfb63616c454d4a65b30e9edadbabd9e50f5174
File: api/system.event/src/main/java/blackberry/system/event/KeyPressHandler.java line 123
By tohman:

It might be not an event thread when calling getActiveScreen. Use invokeLater or acquire an even lock when accessing to ui from outside of event handling or drawing code.
See the *PageManager.java* for reference.