Questions » Recent Q&A » app,exit() doesnt exit app

app,exit() doesnt exit app

Posted Apr 27 2012, 7:04 PM
  • Use this code, will be helpful to you.

    public boolean keyChar(char key, int status, int time)
    {
    boolean retval = false;
    if(key == Characters.ESCAPE)
    {
    retval = true;
    int response = Dialog.ask(Dialog.D_YES_NO, "Do you really want exit??");
    if(response == Dialog.YES)
    System.exit(0);
    }
    else if(key == Characters.ENTER)
    {
    navigationClick(status, time);
    return true;
    }
    else
    {
    retval = super.keyChar(key,status,time);
    }
    return retval;
    }

  •  |   1
    Pawan, have you tested this code?
  • Thanks Pawan!
Back