Help Center
Local Navigation
- Creating user interfaces
- Storing data
- Creating connections
- Managing applications
- Using custom messages and folders in the message list
- Creating a module for background processes
- Creating a module for the UI
- Create the module for background processes
- Start the module for background processes or the module for the UI
- Create an icon for a custom message
- Create a custom folder in the message list
- Send a notification when a custom folder changes
- Create an indicator for the number of messages in a custom folder
- Hide an indicator for a custom folder
- Remove an indicator for a custom folder
- Applications for push content
- Localizing BlackBerry device applications
- Controlling access to APIs and application data
- Testing a BlackBerry device application
- Packaging and distributing a BlackBerry Java Application
- Glossary
- Provide feedback
- Legal notice
BlackBerry Manuals & Help
>
Documentation for Developers
>
Java Development Guides and API Reference
>
Development Guide - BlackBerry Java Development Environment - 4.7.0
Create an indicator for the number of messages in a custom folder
- Import the following classes:
- Store a reference to an ApplicationIndicatorRegistry in an ApplicationIndicatorRegistry variable.
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
- To create an encoded image from an image, invoke EncodedImage.getEncodedImageResource using the name of the image file as an argument. Save a reference to the encoded image in an EncodedImage variable.
EncodedImage image = EncodedImage.getEncodedImageResource( "clowds.gif" );
- To create an BlackBerry® device application
icon based on the encoded image, create an instance of an ApplicationIcon using an EncodedImage as an argument.
ApplicationIcon icon = new ApplicationIcon( image );
- Use an icon with an application indicator.
ApplicationIndicator indicator = reg.register( icon, false, true);
- To retrieve the indicator that theBlackBerry device application registered, invoke ApplicationIndicatorRegistry.getApplicationIndicator() and store the return value in an ApplicationIndicator variable.
ApplicationIndicator AppIndicator = reg.getApplicationIndicator();
- To set the icon and value of an indicator, invoke ApplicationIndicator.set().
AppIndicator.set( newIcon, newValue );
Parent topic: Using custom messages and folders in the message list