本文整理匯總了Java中net.rim.blackberry.api.messagelist.ApplicationIndicator類的典型用法代碼示例。如果您正苦於以下問題:Java ApplicationIndicator類的具體用法?Java ApplicationIndicator怎麽用?Java ApplicationIndicator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ApplicationIndicator類屬於net.rim.blackberry.api.messagelist包,在下文中一共展示了ApplicationIndicator類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateIndicator
import net.rim.blackberry.api.messagelist.ApplicationIndicator; //導入依賴的package包/類
private static void updateIndicator( final int inc ) {
UiApplication.getApplication().invokeLater(new Runnable() {
public void run() {
ApplicationIndicatorRegistry indicatorRegistry = ApplicationIndicatorRegistry.getInstance();
ApplicationIndicator indicator = indicatorRegistry.getApplicationIndicator();
if( indicator == null ) {
ApplicationIcon icon = new ApplicationIcon(net.rim.device.api.system.EncodedImage.getEncodedImageResource("push_small_size_icon.png"));
indicator = indicatorRegistry.register( icon, false, true );
}
unreadCount = inc;
indicator.setValue( unreadCount );
if( unreadCount > 0 ) {
indicator.setVisible( true );
} else {
indicator.setVisible( false );
}
}
});
}
示例2: setValue
import net.rim.blackberry.api.messagelist.ApplicationIndicator; //導入依賴的package包/類
public void setValue(int value) {
try {
ApplicationIndicator indicator = getIndicator();
indicator.setValue(value);
if (value > 0) {
if (!indicator.isVisible()) {
indicator.setVisible(true);
}
} else {
if (indicator.isVisible()) {
indicator.setVisible(false);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例3: register
import net.rim.blackberry.api.messagelist.ApplicationIndicator; //導入依賴的package包/類
private ApplicationIndicator register() {
try {
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
ApplicationIndicator indicator = reg.getApplicationIndicator();
if (indicator == null) {
EncodedImage mImage = EncodedImage.getEncodedImageResource("img/indicator.png");
ApplicationIcon icon = new ApplicationIcon(mImage);
indicator = reg.register(icon, false, true);
indicator.setValue(0);
indicator.setVisible(false);
}
return indicator;
} catch (Exception e) {
return null;
}
}
示例4: getIndicator
import net.rim.blackberry.api.messagelist.ApplicationIndicator; //導入依賴的package包/類
private ApplicationIndicator getIndicator() {
try {
ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
ApplicationIndicator indicator = reg.getApplicationIndicator();
if (indicator == null) {
indicator = register();
}
return indicator;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}