jeevamuthu
jeevamuthu

Reputation: 2054

How To SetFieldChangeListener for ListField in Blackberry?

I am new For Blackberry .. i need some Help. How To SetFieldChangeListener for ListField in Blackberry?

Upvotes: 0

Views: 496

Answers (2)

Mayur Bhola
Mayur Bhola

Reputation: 735

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);

            };
        };

Upvotes: 1

user784540
user784540

Reputation:

This way:

yourListField.setChangeListener(fieldChangeListenerInterfaceImplementation);

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

Upvotes: 2

Related Questions