我正在使用以下代码显示通知消息。
ReadableListImpl mylist= new ReadableListImpl();
ApplicationMessageFolder folder = null;
ApplicationDescriptor daemonDescr = ApplicationDescriptor.currentApplicationDescriptor();
ApplicationDescriptor mainDescr = new ApplicationDescriptor(daemonDescr, "Velocity", new String[] {});
ApplicationFolderIntegrationConfig config = new ApplicationFolderIntegrationConfig(true, true, mainDescr);
if(ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(0x33c7ce29883abe5fL)==null){
folder = ApplicationMessageFolderRegistry.getInstance().registerFolder(0x33c7ce29883abe5fL, "Test Folder", new ReadableListImpl(),config );
}else {
folder = ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(0x33c7ce29883abe5fL);
}
DemoMessage msg = new DemoMessage("name", "Subject","Text body",
System.currentTimeMillis());
mylist.addMessage(msg);
folder.fireElementAdded(msg,true);
这样可以正常工作,但是当我展开新通知字段以查看新通知时,我可以在两个字段(消息和速度)下看到相同的消息。
我不需要在主屏幕中显示此消息字段,但我需要将这些消息添加到消息文件夹
当我将第一个布尔变量更改为false时,“消息”字段消失,但消息也不会添加到“消息”文件夹中
ApplicationFolderIntegrationConfig(false, true, mainDescr);
请告诉我怎么办? (还有两个额外的类demomessage和readblelistimpl如果需要我也可以发布这些代码) 谢谢!