I am trying to get the attachments content from Messages folder. But it is showing the empty string although it is returning the name and size properly. For every file(txt, html or else), it is not returning any string values. For this i am writing the below code:
public boolean supports(String contentType)
{
boolean val;
if (contentType.toLowerCase().indexOf("txt") != -1)
{
val = true;
}
else
val = false;
return val;
}
public void run(Message m, SupportedAttachmentPart p)
{
MainScreen view = new MainScreen();
view.setTitle("Attachment Viewer");
view.add(new RichTextField(new String((byte[])p.getContent())));
view.add(new RichTextField(new String(p.getFilename())));
// PasswordScreen pwd = new PasswordScreen();
Logger.out("eMailMinderApp", "Attachment Content" +new RichTextField(new String((byte[])p.getContent())));
Ui.getUiEngine().pushGlobalScreen(view, 1, UiEngine.GLOBAL_QUEUE);
}
Can anyone please help me in this..as i am stuck here from last two days..
Able to resolve this issue finally. Check here: Blogformobile