can't remove command OK in Alert

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

can't remove command OK in Alert

Postby mycoderules » Wed Aug 22, 2007 8:16 am

hi
I'm developing an application and at some point i'm catching a exception and i'm calling a method wich creates an alarm and displays it on the screen.The alarm has attached one command.(Quit) Now...it seems to work preety well on most of the phones but on Sony Ericsson k610i i get 2 command and the left one doesn't do anything. it is an OK command. What i need is...to remove the useless command but it wouldn't go away.
Here is some code if you could just taka a look at it

Code: Select all
public synchronized void showAlertAndWaitForAction(String aMessage,
        boolean isExitCmdEnabled) {
        //----set title
        Alert al;
        al = new Alert(title, aMessage, null, AlertType.INFO);
        al.setTimeout(Alert.FOREVER);
         if (isExitCmdEnabled) {
            al.addCommand(iCmdExit);
            al.removeCommand(iCmdOK);
        } else {
            al.addCommand(iCmdOK);
            al.removeCommand(iCmdExit);         
        }
        al.removeCommand(Alert.DISMISS_COMMAND);
        al.setCommandListener(this);
      Display.getDisplay(iMIDletBoot).setCurrent(al);
        if (!isExitCmdEnabled){
            try {
                this.wait();
            } catch (InterruptedException e) {
                //#mdebug error
                System.out.println("SplashView:showAlertAndWaitForAction():" +
                        "InterruptedException was thrown");
                //#enddebug
            }
        }
   
    }
mycoderules
 
Posts: 2
Joined: Wed Aug 22, 2007 8:00 am

Postby DevelopmentTeam » Wed Aug 22, 2007 8:49 am

I assume you are speaking about the well known issue on S60 phones. First plz check if the phone has the problem listed in the known bugs. And there will be some solution given my the manufacturer is there a way to avoid it. :)
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

known bugs?

Postby mycoderules » Wed Aug 22, 2007 12:18 pm

do you know where can i find that list of bugs?
i was talking about sony ericsson k610i...and it is not a s60 phone. At least it isn't listed on http://www.s60.com..
thanks
mycoderules
 
Posts: 2
Joined: Wed Aug 22, 2007 8:00 am


Return to J2ME Games

Who is online

Users browsing this forum: No registered users and 2 guests

cron