Используйте следующий код:
public static void registerIndicator() {
EncodedImage mImageGreen = EncodedImage.getEncodedImageResource("res/mail.png");
ApplicationIcon mIconGreen = new ApplicationIcon(mImageGreen);
ApplicationIcon mIcon = mIconGreen;
try {
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
ApplicationIndicator indicator = reg.register(mIcon, false, true);
} catch (Exception ex) { }
}
public static void updateIndicatorValue(int value) {
try {
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
ApplicationIndicator appIndicator = reg.getApplicationIndicator();
appIndicator.setValue(value);
} catch (Exception e) { }
}
public static int getIndicatorValue() {
try {
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
ApplicationIndicator appIndicator = reg.getApplicationIndicator();
return appIndicator.getValue();
} catch (Exception e) { }
return -1;
}