07-17-2007, 06:23 AM
|
#2 (permalink)
|
| Thumbs Must Hurt
Join Date: May 2007 Location: Bulgaria Model: none PIN: N/A Carrier: Mtel
Posts: 150
Post Thanks: 0 Thanked 0 Times in 0 Posts
| So that is a piece of code that i use to send a sms to a friend for example with this number...I catch the event of the trackwheel (clicking the "Send SMS" button) and i tried to invoke the system application of BB to send the sms with this text "some text"...the problem is that i need TextMessage object which constructor get a String as it is the text message...i get an instance of TextMessage like this...here is the code i use:
public boolean trackwheelClick(int status, int time, Field field) {
if (((CustomButtonField) field).getLabel().equals("Send SMS")) {
MessageConnection conn =
(MessageConnection) Connector.open(number);
TextMessage sms =
(TextMessage) conn.newMessage(MessageConnection.TEXT_MESSAGE);
sms.setPayloadText("Some text");
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES,
new MessageArguments(sms));
}
return true;
} |
| Offline
| |