黑莓通知邮件问题 [英] Blackberry Notification Message Issue

查看:117
本文介绍了黑莓通知邮件问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让当我点击的菜单项的通知消息出现,它让我看到指标,但我没有看到消息,有人可以解释在哪里我做错了:

 私人菜单项AMENU =新菜单项(通​​知,101,10)
    {
        公共无效的run()
        {
            ReadableListImpl MYLIST =新ReadableListImpl();
            ApplicationMessageFolder文件夹= NULL;
            如果(ApplicationMessageFolderRegistry.getInstance()。getApplicationFolder(0x33c7ce29883abe5fL)== NULL){                 文件夹= ApplicationMessageFolderRegistry.getInstance()。registerFolder(
                        0x33c7ce29883abe5fL,测试文件夹,MYLIST);            }其他{
                 文件夹= ApplicationMessageFolderRegistry.getInstance()getApplicationFolder(0x33c7ce29883abe5fL)。
            }            // DemoMessage来源是messagelistdemo可用。
            DemoMessage味精=新DemoMessage(me@here.com,比萨浇头,你会在你的比萨喜欢什么?,System.currentTimeMillis的());            mylist.addMessage(MSG);            folder.fireElementAdded(味精,真正的);
            的System.out.println(消息NR+ folder.hasNewMessages());            ApplicationIndicatorRegistry章=
                ApplicationIndicatorRegistry.getInstance();
             恩codeDIMAGE图像= EN codedImage.getEn codedImageResource(new.png);
                ApplicationIcon图标=新ApplicationIcon(图片);
            ApplicationIndicator指标= reg.register(图标,假的,真正的);            ApplicationIndicator appIndicator = reg.getApplicationIndicator();
            appIndicator.setIcon(图标);
            appIndicator.setValue(appIndicator.getValue()+ 1);
            appIndicator.setNotificationState(真);
            appIndicator.setVisible(真);;
        }
    };


解决方案

我注意到两件事情看你的code:

首先,创建一个新的ReadableListImpl每个菜单项被调用的时间。这意味着ReadableListImpl比如你添加到并不总是相同的注册文件夹时所使用的一个消息。所以,你的code应在第一次调用而不是在后续的工作。

二,用BB OS 6的消息可以出现在两个地方,在主屏幕(通知栏)和邮件列表(以下简称信息应用程序)。这可能是可能是您的消息确实曾在邮件列表,但没有在通知栏中显示。从我的经验的邮件显示在只有当消息的状态ApplicationMessage.Status.UNOPENED通知栏。

使用ApplicationFolderIntegrationConfig,如果你想拥有超过您的消息应该显示控制。

I am trying to make a notification message appear when I click the menu item, it shows me the indicator but I don't see the message, can someone explain where i did wrong :

   private MenuItem AMenu = new MenuItem("Notify", 101, 10)
    {
        public void run()
        {
            ReadableListImpl mylist= new ReadableListImpl();
            ApplicationMessageFolder folder = null;
            if(ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(0x33c7ce29883abe5fL)==null){

                 folder = ApplicationMessageFolderRegistry.getInstance().registerFolder(
                        0x33c7ce29883abe5fL, "Test Folder", mylist );

            }else {
                 folder = ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(0x33c7ce29883abe5fL);
            }

            //DemoMessage source is available in the messagelistdemo.
            DemoMessage msg = new DemoMessage("me@here.com", "Pizza Toppings","What would you like on your pizza?", System.currentTimeMillis());

            mylist.addMessage(msg);

            folder.fireElementAdded(msg,true);
            System.out.println("nr of messages"+folder.hasNewMessages());

            ApplicationIndicatorRegistry reg =
                ApplicationIndicatorRegistry.getInstance();
             EncodedImage image = EncodedImage.getEncodedImageResource("new.png" );
                ApplicationIcon icon = new ApplicationIcon( image );
            ApplicationIndicator indicator = reg.register( icon, false, true);

            ApplicationIndicator appIndicator = reg.getApplicationIndicator();
            appIndicator.setIcon(icon);
            appIndicator.setValue(appIndicator.getValue() + 1);
            appIndicator.setNotificationState(true);
            appIndicator.setVisible(true);;
        }
    };

解决方案

I noticed two things looking at your code:

First, you create a new ReadableListImpl each time the menu item gets invoked. This means the ReadableListImpl instance you add the message to is not always the same as the one that was used when registering the folder. So your code should work on first invocation but not on subsequent ones.

Second, with BB OS 6 a message can appear in two places, the home screen (notification bar) and the message list (the 'Messages' app). It might be possible that your message did actually show up in the message list but not in the notification bar. From my experience messages show up in the notification bar only if the message's status is ApplicationMessage.Status.UNOPENED.

Use ApplicationFolderIntegrationConfig if you want to have control over where your message should show up.

这篇关于黑莓通知邮件问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆