11-06-2008 11:34 AM
The following example works on 4.2.1 simulators and devices, and 4.5 and 4.6 simulators (with warnings about the attachment type, though it will view the attachment), but on 4.3 simulators it throws a ClassCastException from within a class called "SMSComposeVerb". I see it occur on both the 8330 and 8130 simulators and I have reports of the bug manifesting on an 8300 series device. In fact, it seems to occur even without the attachment. Is this a known issue and is there a work-around?
Message message = new Message();
message.setFrom(new Address("firstname.lastname@example.org", ""));
message.addRecipient(Message.RecipientType.TO, new Address("email@example.com", ""));
message.setSubject("This is the subject.");
Multipart parts = new Multipart();
parts.addBodyPart(new TextBodyPart(parts, "This is the message body."));
SupportedAttachmentPart part = new SupportedAttachmentPart(parts);
part.setContent("This is an attachment.".getBytes("US-ASCII"));
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(message));
11-06-2008 04:25 PM
I've also seen this issue on the various 4.3 simulators. For some reason, the simulators are lauching the SMS application rather than the Message application when using Invoke(). This is what triggers the cast exception.
AFAIK, the problem does not exist on the actual 4.3.0.xx levels that are out in the field. The only work-around that we have is to not test applications on 4.3 simulators if they require Invoke() on the Message application.