I have created a midlet with multiple lists and after user select one list element he will be directed to another list.I want to call these lists in command actions using List.SELECT_COMMAND and list_one.getselectedIndex( ).It works for only first list and "done" is displayed on listScreen1 when the first index of listScreen1 is selected . As well as again "done " is displayed when the first index of ListScreen2 is selected.How Should i over come from here?I have used switch case also for this instead of If condition and same problem exists.Please help me.Thanx a lot.
there are more problems. I'd say that you will see many times displayed the "Unexpected choice..." message. But the main problem is you are testing all screens at the same time despite any application/screen status. You don't know where you are (on what screen) and you test multiple screens. So the done is always added to the screen 2 (because the condition is always true). Only if current screen is no.2 you just see added content.
- add some more precise application screen/state logic
- manage the screens - you have existing instances of the screens but you multiple times add content and commands
- make corrent conditions
- use CODE tag during editing to enter the code, otherwise it's very bad readable.
Thanx a lot my dearest for the reply and i was waiting here until getting a reply for my question.I understand my fault and i will try to re-correct according to the advices u have given for me.Again thnx a lot for helping me and will inform u all the results back.
I'm facing the same problem with list,how did u fix it?
i'm stuck with this in my project..can u pls tell me
pls post ur code here
pls help me..and if u can pls mail me ur 2 different list in same command action @ firstname.lastname@example.org