我正在使用下面的代码来显示通知消息。
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 我也可以发布这些代码)谢谢!