06-03-2009 10:36 AM
Hello,
My app. adds to the SMS folder a new menu item which the user can select and it will read the address of the highlighted SMS and allow the user to reply\edit\fwd the SMS.
I've managed to add the menu item, but when my app. tries to read the SMS address it fails (i tried to do cast for Datagram class)
Does anyone knows how can i get the SMS address?
Just to clarify myself, i'm using the API of "ApplicationMenuItem" and when the user choose my item, my app. enetrs the "run" function
and there i try to read the address.
Thanks.
Solved! Go to Solution.
06-03-2009 10:43 AM
When you add a menu item to an existing application, then when you have invoked your menu item then a context object has been passed to your code.
Let's assume contextObject is that context object instance.
call the following construction to realize the full qualified name of this context object class:
System.out.println(contextObject.getClass().getNam
When you have realized the contextObject class inspect its methods via javadocs and act accordingly.
06-04-2009 01:33 AM
Hi,
I tried your suggestion and the class name is: net.rim.device.cldc.io.sms.TextMessageImpl
However i couldn't find it in the RIM JDE at all, do you have an idea to which class i should try to cast it?
Thanks.
06-04-2009 05:35 AM
This context object is an instalnce of implementation of
javax.wireless.messaging.TextMesssage
interface.
This interface extends
javax.wireless.messaging.Message
interface.
You can do the following:
Message messageObject = (Message) contextObject;
String address = messageObject.getAddress();
that's it.