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 - Blackberry JAVA DEVELOPMENT ENVIRONMENT - - DEVELOPMENT GUIDE Manual

Version: 4.7.0
Hide thumbs Also See for JAVA DEVELOPMENT ENVIRONMENT - - DEVELOPMENT GUIDE:
Table of Contents

Advertisement

Development Guide

Create an indicator for the number of messages in a custom folder

1.
Import the following classes:
• net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry
• net.rim.device.api.system.EncodedImage
• net.rim.blackberry.api.messagelist.ApplicationIcon
• net.rim.blackberry.api.messagelist.ApplicationIndicator
2.
Store a reference to an ApplicationIndicatorRegistry in an ApplicationIndicatorRegistry
variable.
ApplicationIndicatorRegistry reg =
ApplicationIndicatorRegistry.getInstance();
3.
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" );
4.
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 );
5.
Use an icon with an application indicator.
ApplicationIndicator indicator = reg.register( icon, false, true);
6.
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();
7.
To set the icon and value of an indicator, invoke ApplicationIndicator.set().
AppIndicator.set( newIcon, newValue );

Hide an indicator for a custom folder

1.
Import the net.rim.blackberry.api.messagelist.ApplicationIndicator class.
2.
To temporarily hide the indicator, invoke ApplicationIndicator.setVisible().
OldIndicator.setVisible( false );

Remove an indicator for a custom folder

1.
Import the net.rim.blackberry.api.messagelist.ApplicationIndicatorRegistry class.
74
Create an indicator for the number of messages in a custom folder

Advertisement

Table of Contents
loading

This manual is also suitable for:

Java development environment

Table of Contents