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

Web and WebWorks Development

Reply
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Re: Widget and banner notification

Thank you so much for this - it was a major stumbling block in my app. It works now.

 

Thanks again.

Please use plain text.
Developer
agungeddy
Posts: 164
Registered: ‎08-26-2010
My Device: Not Specified

Re: Widget and banner notification

Congratulation...

Please use plain text.
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Re: Widget and banner notification

I still have a few lingering questions - how do I update the indicator counter and how to clear the indicator after I am done with it?

Please use plain text.
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Re: Widget and banner notification

Found it!

 

I added the following,

 

if (args.length == 1) {     
                int counter = ((Integer)args[0]).intValue();     
                AppIndicator.setValue(counter);
                AppIndicator.setVisible(true);
                }
            if (args.length == 2) {     
                int display = ((Integer)args[1]).intValue();     
                if (display == 0) {
                    AppIndicator.setVisible(false);
                    }

 

now when I call ChangeIcon(x) where x is number to be displayed beside icon.

 

ChangeIcon(0,0) will clear the icon and counter from the notification bar.

Please use plain text.
Contributor
ananddrs
Posts: 14
Registered: ‎10-08-2010
My Device: 9700
My Carrier: Rogers

Re: Widget and banner notification

Thank you for the contributions in this thread. It did save my time.

 

I want to mention here that when updating the indicator icon i.e. from visible to invisible make certain that you update the same instance of what you have previously registered by using getApplicationIndicator().

 

I was struggling with this a bit and I thought it's useful share.

 

 

Please use plain text.
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Re: Widget and banner notification

Could you post your code - I am having difficulty with the unregister portion.

 

Thanks

Please use plain text.
Developer
csibbdev
Posts: 67
Registered: ‎09-23-2010
My Device: Curve
My Carrier: T-Mobile

Re: Widget and banner notification

This piece of code does the trick in changeicon.java

ApplicationIndicatorRegistry reg1 = ApplicationIndicatorRegistry.getInstance();
    		        	ApplicationIndicator AppIndicator1 = reg1.getApplicationIndicator();
    		        	AppIndicator1.setVisible(false);
    					reg1.unregister();

 

 

Please use plain text.