The following code allows you to change the program icon
Bitmap Icon=bitmap.getbitmapresource ("Icon/unread.gif");
Net.rim.blackberry.api.homescreen.HomeScreen.updateIcon (icon,1);
But it's not cool enough to add numbers to the icons. Numbers are used to indicate how many are to be done, or how much the temperature is.
To improve the code above:
Bitmap Icon=bitmap.getbitmapresource ("Icon/unread.gif");
Bitmap Icon1 = Getupdateiconbitmap (icon, count);
Net.rim.blackberry.api.homescreen.HomeScreen.updateIcon (icon1,1);
Private Bitmap Getupdateiconbitmap (Bitmap bmp, int count) {
int width = bmp.getwidth ();
int height = bmp.getheight ();
Bitmap iconbmp = new Bitmap (width, height);
Graphics g = new Graphics (iconbmp);
Xyrect rect = new Xyrect (0, 0, width, height);
G.drawbitmap (rect, BMP, 0, 0);
G.setfont (G.getfont (). Derive (Font.Bold, UI.UNITS_PX,
Font.antialias_standard, Font.colored_outline_effect));
String Text = integer.tostring (count);
G.setcolor (color.red);
G.drawtext (text, 0, 0);
return iconbmp;
}