Welcome!

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

Java Development

Reply
Developer
Posts: 64
Registered: ‎01-12-2009
My Device: Blackberry Storm, Curve, Tour
My Carrier: Verizon

startNotification context object - any information?

Hi Folks,

 I am probably missing something obvious but I can't find it: 

 

I registered a notification event,  set up Consequences and properly receive events in my startNotification method. So far so good.

 

 The Consequences DEMO app never mentions or uses the other parameters in the startNotification() method, so it is no help to me for what I would like to do.

 

public void startNotification(long consequenceID, long sourceID, long eventID, Object configuration,                        Object context)

 

 

 

public static void triggerImmediateEvent(long sourceID,
                                         long eventID,
                                         Object eventReference,
                                         Object context)

 

My PROBLEM: I trigger an immediateEvent setting the context Object and the eventReference objects to junk Strings (for testing).   I expected the context objects I set in that call to appear in the startNotification() method. Not the case; I get some unknown Object.

 

Two questions: 1) why does triggerEvent have "eventReference" and "context" Objects? Where and how are they reference-able?

2) What is the context object I get back in the startNotification() method? Is there an interface published? It is listed as: "net.rim.device.apps.api.framework.model.ContextObject". 

 

Ken J Kelly
Developer
Posts: 1,474
Registered: ‎04-14-2009
My Device: Not Specified

Re: startNotification context object - any information?

I'm pretty rusty on this. I suggest you check whether the context object is a subclass of LongHashtable or IntHashtable (I believe it was a subclass of one of the containers from the net.rim.device.api.util package)... If it is, you can then at least access the map represented by the object.

Developer
Posts: 64
Registered: ‎01-12-2009
My Device: Blackberry Storm, Curve, Tour
My Carrier: Verizon

Re: startNotification context object - any information?

Thanks klyubin,

  it does look "hash-like' in the debugger. I'll try those.

 ken

Ken J Kelly
Highlighted
Regular Contributor
Posts: 67
Registered: ‎09-30-2009
My Device: Not Specified

Re: startNotification context object - any information?

Thank you, klyubin - that really helped