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

Posts: 228
Registered: ‎10-01-2011
My Device: Passport
Accepted Solution

Forcing application Indicator to update

My application uses an application indicator (OS 7.0) however even though I can see the value is being correctly set, the count new to the icon does not update. 


The initial value is correctly set using this :


protected static void setIndicator(){
      int unreadCount = PersistentStorage.getUnreadMessageCount();
      EncodedImage image = EncodedImage.getEncodedImageResource("indicator.png");
     ApplicationIcon icon = new ApplicationIcon(image);
     ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
     indicator = reg.register(icon, false, true);


Here is the update code:


public static void updateIndicator(final int value, boolean absolute) {
    // Update indicator
    final ApplicationIndicator indicator = ApplicationIndicatorRegistry.getInstance().getApplicationIndicator();
    if (indicator == null) {

    if (absolute)
             indicator.setValue(indicator.getValue() + value);


The code is always called as expected and the indicator value can be read back and is correct, just the value next to the indicator doesn't update. I would try to call Invalidate() on the indicator but doesn't any such function.


Any tip?





Posts: 17,023
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Forcing application Indicator to update

i suspect this being a problem of the static context and would suggest that you put the indicator into the runtimestore.
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
Posts: 228
Registered: ‎10-01-2011
My Device: Passport

Re: Forcing application Indicator to update

Thanks,   the static context was the issue. The silent API strikes again.