0
我試圖從Messages文件夾中獲取附件內容。但它顯示空字符串,雖然它正確地返回名稱和大小。對於每個文件(txt,html或其他),它不會返回任何字符串值。對於這個我寫了下面的代碼:無法使用BlackBerry中的附件處理程序檢索附件內容
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);
}
任何人都可以請幫我在this..as我在這裏堅持從最近兩天..