0

私はBlackberryの新人です..助けが必要です。Blackberry で 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 に答える