blackberry - How to send a checkbox field that is checked as a parameter to pushScreen -
i wrote simple program push screen whenever field in checkbox in checked. code:
public myscreen() { // set displayed title of screen settitle("sfts"); labelfield datelabel = new labelfield("today's route paln",field.field_hcenter); add(datelabel); _datefield = new datefield("date/time: ", system.currenttimemillis(), datefield.date_time); add(_datefield); add(new separatorfield()); for(i=0;i<name.length;i++) { s[i]=new checkboxfield(name[i]+","+addr[i]+","+time[i],false); add(s[i]); s[i].setchangelistener(f); } } fieldchangelistener f=new fieldchangelistener() { public void fieldchanged(field field, int context) { uiapplication.getuiapplication().pushscreen(new secondscreen(field)); } };
there no error while compiling whenever check field in checkbox, getting illegalstateexcpetion in emulator. please me out. thank you
you need declare size of checkbox.
s=new checkboxfield[name.length];
try this, think got solution.
Comments
Post a Comment