ApplicationIndicator is not working, blackberry
I am trying to display an icon (.png) in the notification bar of my blackberry simulator (OS5, OS6 and OS7). I tried to use both ApplicationIndicator API and also HomeScreen.updateIcon, setRolloverIcon() methods but neither worked.

**Using HomeScreen**:
----------------

    Bitmap defaultIcon = Bitmap.getBitmapResource("icon1.png");
    
    Bitmap rolloverIcon = Bitmap.getBitmapResource("icon2.png");
    
    HomeScreen.updateIcon(rolloverIcon, 1);
    
    HomeScreen.setRolloverIcon(defaultIcon, 1);
    
    Dialog.alert("Timezone changed!!");


**Using ApplicationIndicator**:
---------------------------

    try
    {
    	EncodedImage icon = EncodedImage.getEncodedImageResource("icon1.png");
    
    	// create an application icon with the given image.
    	ApplicationIcon newIcon = new ApplicationIcon(icon);
    	
    	// get an instance of Application Indicator Registry
    	ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
    	
    	ApplicationIndicator appIndicator = reg.register(newIcon, false, true);
    
    	appIndicator.setIcon(newIcon);
    
    	appIndicator.setVisible(true);
    }
    catch (Exception ex) {
    }

---------------------------------------

I want to display the icon based on an event such as "TIMEZONE_CHANGED". When I display a simple dialog with some text, it works fine. But when I try to do the way as I mentioned above, it doesn't. It sometimes throws IllegalStaeChangeException. Not sur ehow can I achieve this. I heard it is possible to change the application icon dynamically based on events in Blackberry. Can anyone post a sample code or help me correct mine?

Highly appreciate your help.

Thanks,
Nanda K.
ApplicationIndicator is not working, blackberry
===

I am trying to display an icon (.png) in the notification bar of my blackberry simulator (OS5, OS6 and OS7). I tried to use both ApplicationIndicator API and also HomeScreen.updateIcon, setRolloverIcon() methods but neither worked.

**Using HomeScreen**:
----------------

    Bitmap defaultIcon = Bitmap.getBitmapResource("icon1.png");
    
    Bitmap rolloverIcon = Bitmap.getBitmapResource("icon2.png");
    
    HomeScreen.updateIcon(rolloverIcon, 1);
    
    HomeScreen.setRolloverIcon(defaultIcon, 1);
    
    Dialog.alert("Timezone changed!!");


**Using ApplicationIndicator**:
---------------------------

    try
    {
    	EncodedImage icon = EncodedImage.getEncodedImageResource("icon1.png");
    
    	// create an application icon with the given image.
    	ApplicationIcon newIcon = new ApplicationIcon(icon);
    	
    	// get an instance of Application Indicator Registry
    	ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
    	
    	ApplicationIndicator appIndicator = reg.register(newIcon, false, true);
    
    	appIndicator.setIcon(newIcon);
    
    	appIndicator.setVisible(true);
    }
    catch (Exception ex) {
    }

---------------------------------------

I want to display the icon based on an event such as "TIMEZONE_CHANGED". When I display a simple dialog with some text, it works fine. But when I try to do the way as I mentioned above, it doesn't. It sometimes throws IllegalStaeChangeException. Not sur ehow can I achieve this. I heard it is possible to change the application icon dynamically based on events in Blackberry. Can anyone post a sample code or help me correct mine?

Highly appreciate your help.

Thanks,
Nanda K.