當前位置: 首頁>>代碼示例>>Java>>正文


Java ApplicationIndicator類代碼示例

本文整理匯總了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 );
            }
        }
    });
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:22,代碼來源:BlackBerryOS5Implementation.java

示例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();
    }
}
 
開發者ID:yanex,項目名稱:vika,代碼行數:18,代碼來源:Indicator.java

示例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;
    }
}
 
開發者ID:yanex,項目名稱:vika,代碼行數:17,代碼來源:Indicator.java

示例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;
    }
}
 
開發者ID:yanex,項目名稱:vika,代碼行數:14,代碼來源:Indicator.java


注:本文中的net.rim.blackberry.api.messagelist.ApplicationIndicator類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。