22
BlackBerry Device Applications Integration Guide
Reply to a message
Task
Steps
Reply to an existing message.
1.
Invoke
Session.getTransport()
and store the returned object in a variable of type
Transport
. The
Transport
object represents the messaging transport protocol.
Transport trans = Session.getTransport();
>
Invoke
Message.reply(Boolean)
and specify
true
to reply to all message recipients or
false
to reply to only the sender.
Store store = Session.waitForDefaultSession().getStore();
Folder[] folders = store.list(INBOX);
Folder inbox = folders[0];
Message[] messages = inbox.getMessages();
if( messages.length > 0 ) {
Message msg = messages[0];
}
Message reply = msg.reply(true);
trans.send(reply);
Summary of Contents for JAVA DEVELOPMENT ENVIRONMENT - - DEVICE APPLICATIONS INTEGRATION - DEVELOPMENT GUIDE
Page 4: ......
Page 7: ......
Page 10: ...10 BlackBerry Device Applications Integration Guide...
Page 12: ...12 BlackBerry Device Applications Integration Guide...
Page 50: ...50 BlackBerry Device Applications Integration Guide...
Page 56: ...56 BlackBerry Device Applications Integration Guide...
Page 65: ......
Page 66: ...2008 Research In Motion Limited Published in Canada...