thanks for the reply...
No exceptions were thrown by the device , just LSK and RSK gets hanged after coming back to the form from choicgroup POPUP list.
All other keys were working fine.
I have added buttons. My J2me code is....
Code:
public class TestMidlet extends MIDlet implements CommandListener{
private Form form;
private StringItem str_test;
private TextField tf1;
private TextField tf2;
private ChoiceGroup ch1;
private Command cmd_Ok;
private Command cmd_Exit;
private String[] arr_Relation = {"Father","Mother","Brother","Sister"
,"Wife","Husband","Uncle","Cousin"
,"Father-in-law", "Mother-in-law"
,"Brother-in-law","Sister-in-law"
,"Grandfather","Grandmother"
,"Grandson","Granddaughter"};
private boolean isPaused= false;
public TestMidlet() {
// TODO Auto-generated constructor stub
//midletInstance = this;
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
System.out.println("In destroy app");
}
protected void pauseApp() {
// TODO Auto-generated method stub
System.out.println("In pause app");
isPaused = true;
}
protected void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
System.out.println("In start app");
if(!isPaused){
Display display = Display.getDisplay(this);
form = new Form ("Test Form");
str_test = new StringItem("Hello World","Hello J2ME",StringItem.PLAIN);
tf1 = new TextField("Textfield 1","",20,TextField.ANY);
tf2 = new TextField("Textfield 2","",20,TextField.ANY);
ch1 = new ChoiceGroup("Choicegroup 1",ChoiceGroup.POPUP,arr_Relation,null);
// append form items
form.append(str_test);
form.append(tf1);
form.append(tf2);
form.append(ch1);
cmd_Exit = new Command("Exit",Command.EXIT,0);
cmd_Ok = new Command("OK",Command.OK,0);
// add commands
form.addCommand(cmd_Ok);
form.addCommand(cmd_Exit);
form.setCommandListener(this);
// display form
display.setCurrent(form);
}else{
System.out.println("midlet resumed");
}
}
public void commandAction(Command arg0, Displayable arg1) {
// TODO Auto-generated method stub
if(arg0.getLabel().equals("Exit")){
notifyDestroyed();
}else if( arg0 == cmd_Ok){
form.append("Ok called");
}
}
}
As mentioned in my earlier post that it was found with combination of textfield and choicegroup on same form , If I didnt append textfields then LSK and RSK not get hanged after coming from choicegropu popup list to form.
What is the reason behind this?
Thanks All....