0

我是黑莓新手 .. 我需要一些帮助。如何在黑莓中为 ListField 设置FieldChangeListener?

4

2 回答 2

2

这边走:

yourListField.setChangeListener(fieldChangeListenerInterfaceImplementation);

实现FieldChangeListener并将实现实例传递给setChangeListener()

于 2011-08-16T13:42:38.870 回答
1
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);

            };
        };
于 2011-08-19T13:59:11.420 回答