且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

黑莓 - 对mesage通知点击打开的应用程序

更新时间:2023-01-01 17:43:49

最近,我挣扎着这同一个问题。当用户打开一个 ApplicationMessage 对象, ApplicationMessageFolderListener.actionPerformed()不通知。如果用户标记为没有实际打开它打开了该邮件就被通知。一些挖后,这是由设计。

I recently struggled with this very same problem. When a user opens an ApplicationMessage object, ApplicationMessageFolderListener.actionPerformed() is not notified. It is notified if the user marks the message as opened without actually opening it. After some digging, this is by design.

要得到通知时,该消息实际上是打开,你必须实现它扩展了 ApplicationMenuItem 类,并覆盖其运行类()方法。在背景参数将被设置为正被打开 ApplicationMessage 对象。然后,您可以使用 ApplicationMessageFolderRegistry.registerMessageMenuItems()方法,该菜单项适用于特定消息的状态组合,如 ApplicationMessage注册该菜单项.Status.UNOPENED

To get notified when the message is actually opened, you have to implement a class that extends the ApplicationMenuItem class and overrides its run() method. The context parameter will be set to the ApplicationMessage object that is being opened. You can then register that menu item using the ApplicationMessageFolderRegistry.registerMessageMenuItems() method for the particular message state combinations that the menu item applies to, such as ApplicationMessage.Status.UNOPENED.