for (int index = 0; index < multipart.getCount(); index++) {
final BodyPart bodyPart = multipart.getBodyPart(index);
// If this body part is text then display all of it
if (bodyPart instanceof TextBodyPart) {
final TextBodyPart textBodyPart = (TextBodyPart) bodyPart;
// If there are missing parts of the text, try to retrieve the
// rest of it.
if (textBodyPart.hasMore()) {
try {
Transport.more(textBodyPart, true);
} catch (final Exception e) {
BlackBerryMailDemo
.errorDialog("Transport.more(BodyPart, boolean) threw "
+ e.toString());
}
}
final String plainText = (String) textBodyPart.getContent();
// Display the plain text, using an EditField if the message is
// editable or a RichTextField if it is not editable. Note: this
// does not add any empty fields.
if (plainText.length() != 0) {