_status = new EditField();
add(_status);
// Menu item to attach a picture to the MMS
final MenuItem attachPicture =
new MenuItem(new StringProvider("Attach Picture"), 0x230010, 0);
attachPicture.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
_app.attach(MMSDemo.PICTURE);
}
}));
// Menu item to attach an audio file to the MMS
final MenuItem attachAudio =
new MenuItem(new StringProvider("Attach Audio"), 0x230020, 1);
attachAudio.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
_app.attach(MMSDemo.AUDIO);
}
}));
// Menu item to send the MMS
final MenuItem sendMenuItem =
new MenuItem(new StringProvider("Send"), 0x230030, 3);
sendMenuItem.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)
*/
public void execute(final ReadOnlyCommandMetadata metadata,
final Object context) {
// Send MMS on non-event thread
final Thread t = new Thread() {
public void run() {
_app.sendMMS(_addressField, _subjectField,
_messageField);
}
};
t.start();
}
}));
_removeAttachment =
new MenuItem(new StringProvider("Remove Attachment"), 0x230040,
4);
_removeAttachment.setCommand(new Command(new CommandHandler() {
/**
* @see net.rim.device.api.command.CommandHandler#execute(ReadOnlyCommandMetadata,
* Object)