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

Java Development

Reply
Developer
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na

icon notification at the status bar

I am suing the HTTPPUSHDEMO to show push notifications.Everythig is workingas expected.Now i want to add icon notification at  the top,so that if a new message comes,it should show in the notification bar with the updated message count

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: icon notification at the status bar

if you only want to show the icon/count check http://www.blackberry.com/developers/docs/7.1.0api/net/rim/blackberry/api/messagelist/ApplicationInd...

if you also want to integrate with the message list check the messagelist demo in your samples folder.
----------------------------------------------------------
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
Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: icon notification at the status bar

Have you searched to see if a similar question has been asked in the past?

Developer
arunbiet
Posts: 384
Registered: ‎06-22-2010
My Device: na

Re: icon notification at the status bar

Yes i searched and found some sample

private void registerIndicator() {
try {
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
.getInstance();
indicator =
reg.register(mIcon, false, true);
} catch (Exception e) {
}
}

private void unregisterIndicator() {
try {
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
.getInstance();
reg.unregister();
} catch (Exception e) {
}
}

void updateValue(int value) {
try {
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry
.getInstance();
indicator =
reg.getApplicationIndicator();
indicator.setValue(value);
} catch (Exception e) {
}
}

 

but its not working

Developer
simon_hain
Posts: 16,282
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport

Re: icon notification at the status bar

does not look like an official sample, catching exceptions without doing anything is rarely a good thing to do.

"its not working" is also not a very good error description, especially with my crystal ball being all cloudy today.
----------------------------------------------------------
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