Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
titakalpesh
Posts: 203
Registered: ‎07-30-2009
My Device: Bold(9780),Curve(8520)
My Carrier: Vodafone

Issue with local notification

Hi there!!!

 

I'm trying to add notification message at notification bar available from OS 6.0 and I get the below code but it's not Working the message it's just show the icon with count so any buddy have any idea about it please help me to solve out.

 

 

ReadableListImpl collection = new ReadableListImpl();
            ApplicationMessageFolderRegistry amfr = ApplicationMessageFolderRegistry
                    .getInstance();
            ApplicationFolderIntegrationConfig app = new ApplicationFolderIntegrationConfig(
                    true, true,
                    ApplicationDescriptor.currentApplicationDescriptor());
            ApplicationMessageFolder folder = amfr.registerFolder(
                    0x33c7ce29883abe5fL, "My Folder", collection, app);
            ApplicationIcon icon = new ApplicationIcon(
                    EncodedImage.getEncodedImageResource("Indicator.png"), true);
            int status = ApplicationMessage.Status.INCOMING
                    | ApplicationMessage.Status.UNOPENED;

            amfr.registerMessageIcon(0, status, icon);
            folder.setSearchProperties(new ApplicationMessageSearchProperties(
                    true));
            
            amfr.setBulkMarkOperationsSupport(0, status, true, false);

            // Register icon for indicator
            ApplicationIndicatorRegistry air = ApplicationIndicatorRegistry
                    .getInstance();
            air.register(icon, false, false);

            // Add a message
            // MyApplicationMessage implements ApplicationMessage
            DemoMessage myMessage = new DemoMessage("me@here.com",
                    "Pizza Toppings", "What would you like on your pizza?",
                    System.currentTimeMillis());
            collection.addMessage(myMessage);
            folder.fireElementAdded(myMessage);

            // Update indicator
            ApplicationIndicator ai = air.getApplicationIndicator();
            int size = collection.size();
            ai.setValue(size);
            ai.setVisible(size > 0);

 

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: Issue with local notification

did you try the message list demo? does it work correcty? if yes, modify it to yur needs until it does no longer work and check why.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter