addTextFieldToTableAndScreen(new RichTextField(
plainText), BODY);
}
}
} else if (bodyPart instanceof MimeBodyPart) {
final MimeBodyPart mimeBodyPart = (MimeBodyPart) bodyPart;
// If the content is text then display it
final String contentType = mimeBodyPart.getContentType();
if (contentType
.startsWith(BodyPart.ContentType.TYPE_TEXT_HTML_STRING)) {
final Object obj = mimeBodyPart.getContent();
if (obj != null) {
final String htmlText = new String((byte[]) obj);
addTextFieldToTableAndScreen(
new RichTextField(htmlText), BODY);
}
} else if (contentType
.equals(BodyPart.ContentType.TYPE_MULTIPART_ALTERNATIVE_STRING)) {
// If the body part is a multi-part and it has the the
// content type of TYPE_MULTIPART_ALTERNATIVE_STRING, then
// recursively display the multi-part.
final Object obj = mimeBodyPart.getContent();
if (obj instanceof Multipart) {
final Multipart childMultipart = (Multipart) obj;
final String childMultipartType =
childMultipart.getContentType();
if (childMultipartType