Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Posts: 124
Registered: ‎09-06-2010
My Device: Not Specified


BlackBerry WebWorks for Smartphones (OS 5.0 and 6.0).


I'm developing a WebWorks extension in Java.  My app is going to the background, and I'm having a hard time figuring out how to listen for an event that tells me when my application has been brought to the foreground.


In a regular Java application, you can override activate(), but WebWorks does that in the BlackBerryWidgetToolkit class.  In that method, it triggers an event using


triggerOverridableEvent(BlackBerryWidgetToolkit.EVT_APP_FOREGROUND, null);




    /* Override */ public void activate() {
BlackBerryWidgetToolkit.EVT_APP_FOREGROUND, null);

//If we're switching application from the background we should change location to the widget content source.
if(_locationURI.equals(((WidgetConfigImpl)_wConfig).getBackgroundSource())) {

 I can't figure out how to catch this event, or what listener to use.  I tried GlobalEventListener.  No dice.  The Javadoc for triggerOverridableEvent states:


"Triggers an event that is propagated to all listeners in the library."


Does that include listeners that I've added to the application before it was backgrounded?





Posts: 124
Registered: ‎09-06-2010
My Device: Not Specified

Re: BlackBerryWidgetToolkit.triggerOverridableEvent

Please, RIM, take a look at this.


How do you catch the foreground event from a Widget/WebWorks app (on the Java extension side!)?  Manipulating the generated source code is not an option for me.  All my 'workarounds' are nothing short of ugly.


How do I trap this: