tags:

views:

7

answers:

0

I want to set gauge object in Alert to show the progress but it is giving java.lang.IllegalArgumentException

public class AlertTest extends MIDlet implements CommandListener {
Display display;
TextBox txtbox;
Command cmd;
public void startApp() {
    display=Display.getDisplay(this);
    txtbox=new TextBox("Message", null, 160, 0);
    cmd=new Command("Send", Command.OK, 1);
    txtbox.addCommand(cmd);
    txtbox.setCommandListener(this);
    display.setCurrent(txtbox);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c,Displayable d){
     Gauge gauge = new Gauge("", false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING);
     Alert retrieve = new Alert("Retrieving Contacts");       
            retrieve.setIndicator(gauge);
            display.setCurrent(retrieve,txtbox);
}

}

how to solve this problem?