tags:

views:

126

answers:

1

Hi friends,

I need to develop the blackberry application using jave (eclips), can you please help me what are the events for dropdown and how to read the value of dropdown list , i tried using getText() method but its given error, can u please give small example on dropdown list in blackberry

+1  A: 
final String[] data = {"A", "B","C","D"};
        ObjectChoiceField ocf = new ObjectChoiceField("Set your status", data);
        ocf.setChangeListener(new FieldChangeListener(){
            public void fieldChanged(Field field, int context) {
                if(context != PROGRAMMATIC)
                Dialog.alert(data[ocf.getSelectedIndex()]);

            }

        });
Vivart
Hi ThankQ so much,ur code is working fine
upendra