Accessing sms from added menu context
Please Login to Remove!
I have added the following menu item in the Messages list view as
amir.addMenuItem(ApplicationMenuItemRepository.MEN UITEM_MESSAGE_LIST,
new SampleMenuItem());
private static class SampleMenuItem extends ApplicationMenuItem {
SampleMenuItem() {
super(20);
}
public String toString() {
return "Print Message";
}
public Object run(Object context) {
Type c = (Type)context; //an error if this doesn't work
if ( c != null ) {
// new ContactsDemo().enterEventDispatcher();
} else {
throw new IllegalStateException( "Context is null, expected a Contact instance");
}
net.rim.device.api.ui.component.Dialog.alert("View ing an email message in the email view");
return null;
}
}
}
But i dont know how to access the sms contet of the selected message.
On debuging the context type isw shown as net.rim.device.cldc.io.sms.TextMessageImpl
but i am unable to type cast the context to net.rim.device.cldc.io.sms.TextMessageImpl
please help me
|