Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Unfortunately it's not possible. What you can do is update application icon.</p> <p>Also there are alternative ways of notification:<br> <a href="https://stackoverflow.com/questions/1465259/notification-service-for-blackberry-os-4-5-application">Notification Service for Blackberry OS 4.5 application</a></p> <h2>Update Application Icon</h2> <p><a href="http://img211.imageshack.us/img211/4527/icoupdate1.jpg" rel="nofollow noreferrer">alt text http://img211.imageshack.us/img211/4527/icoupdate1.jpg</a><a href="http://img697.imageshack.us/img697/3981/icon.jpg" rel="nofollow noreferrer">alt text http://img697.imageshack.us/img697/3981/icon.jpg</a><a href="http://img687.imageshack.us/img687/256/iconactive.jpg" rel="nofollow noreferrer">alt text http://img687.imageshack.us/img687/256/iconactive.jpg</a><a href="http://img130.imageshack.us/img130/3277/icoupdate2.jpg" rel="nofollow noreferrer">alt text http://img130.imageshack.us/img130/3277/icoupdate2.jpg</a><a href="http://img691.imageshack.us/img691/6459/icoupdate3.jpg" rel="nofollow noreferrer">alt text http://img691.imageshack.us/img691/6459/icoupdate3.jpg</a><br> Background running application:</p> <pre><code>public class NotifIconSrvc extends Application { private int mCount = 0; private int mSize = 0; public NotifIconSrvc() { Timer timer = new Timer(); timer.schedule(sendEventTask, 1000, 3000); } TimerTask sendEventTask = new TimerTask() { public void run() { // Post the GlobalEvent. // Long = ci.samples.45.notificon ApplicationManager.getApplicationManager().postGlobalEvent( 0x5a9f7caa171ab7b8L, mCount++, mSize++); } }; public static void main(String[] args) { NotifIconSrvc app = new NotifIconSrvc(); app.enterEventDispatcher(); } } </code></pre> <p>Main application:</p> <pre><code>public class NotifIconApp extends UiApplication implements GlobalEventListener { private Bitmap mIcon = Bitmap.getBitmapResource("icon.png"); private Bitmap mIconActive = Bitmap.getBitmapResource("icon_active.png"); private Scr mScreen = new Scr(); public NotifIconApp() { addGlobalEventListener(this); pushScreen(mScreen); } public static void main(String[] args) { NotifIconApp app = new NotifIconApp(); app.enterEventDispatcher(); } public void eventOccurred(long guid, int count, int size, Object object0, Object object1) { if (0x5a9f7caa171ab7b8L == guid) { Bitmap icon = getUpdateIconBitmap(mIcon, count, size); HomeScreen.updateIcon(icon); Bitmap rolloverIcon = getUpdateIconBitmap(mIconActive, count, size); HomeScreen.setRolloverIcon(rolloverIcon); mScreen.updateScreen(count, size); } } private Bitmap getUpdateIconBitmap(Bitmap bmp, int count, int size) { 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, 20, Ui.UNITS_px, Font.ANTIALIAS_STANDARD, Font.COLORED_OUTLINE_EFFECT)); String text = Integer.toString(count); g.setColor(Color.BLACK); g.drawText(text, 0, 2); text = Integer.toString(size) + " Kb"; g.setColor(Color.GREEN); g.drawText(text, 0, height - 22); return iconBmp; } } class Scr extends MainScreen { LabelField mMessages; String mLabelText = "message count: "; String mTitleText = "message counter"; public Scr() { add(mMessages = new LabelField(mLabelText)); setTitle(mTitleText); } void updateScreen(int count, int size) { StringBuffer sb = new StringBuffer(Integer.toString(count)); sb.append("/"); sb.append(Integer.toString(size)); sb.append("Kb"); String text = sb.toString(); setTitle(mTitleText + "(" + text + ")"); mMessages.setText(mLabelText + text); } protected void makeMenu(Menu menu, int instance) { super.makeMenu(menu, instance); menu.add(mMenuGoBG); } MenuItem mMenuGoBG = new MenuItem("go background", 0, 0) { public void run() { UiApplication.getUiApplication().requestBackground(); } }; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload