01-19-2011 09:40 AM
Thank you so much for this - it was a major stumbling block in my app. It works now.
Thanks again.
01-19-2011 09:55 AM
Congratulation...
01-27-2011 07:12 PM
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?
01-27-2011 09:21 PM
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.
01-28-2011 03:14 PM
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.
03-08-2011 07:45 PM
Could you post your code - I am having difficulty with the unregister portion.
Thanks
03-08-2011 08:34 PM
This piece of code does the trick in changeicon.java
ApplicationIndicatorRegistry reg1 = ApplicationIndicatorRegistry.getInstance();
ApplicationIndicator AppIndicator1 = reg1.getApplicationIndicator();
AppIndicator1.setVisible(false);
reg1.unregister();