开发者

How To SetFieldChangeListener for ListField in Blackberry?

开发者 https://www.devze.com 2023-03-28 05:32 出处:网络
I am new For Blackberry .. i need some Help. How To SetFieldChangeListener for 开发者_StackOverflowListFieldin Blackberry?This way:

I am new For Blackberry .. i need some Help. How To SetFieldChangeListener for 开发者_StackOverflowListField in Blackberry?


This way:

yourListField.setChangeListener(fieldChangeListenerInterfaceImplementation);

Implement FieldChangeListener and pass the implementation instance to setChangeListener();


listField = new ListField() {
        protected boolean invokeAction(int action) {
        UiApplication.getUiApplication().invokeLater(new Runnable() {
           public void run() {

                    <** apply your code here **>                    

                    }
                });
                return true;
            };

            public void focusChangeNotify(int index) {
                mainlist = listField.getSelectedIndex();
                listField.invalidate();
                super.focusChangeNotify(index);
            };

            protected void onUnfocus() {
                mainlistflag = true;
                listField.invalidate();
                super.onUnfocus();
            };

            protected void onFocus(int direction) {

                mainlistflag = false;
                super.onFocus(direction);

            };
        };
0

精彩评论

暂无评论...
验证码 换一张
取 消