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 开发者_StackOverflow社区= 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?
Gauge label should be set to null when used within Alert:
For example:
Gauge gauge = new Gauge(null, false, Gauge.INDEFINITE, Gauge.CONTINUOUS_RUNNING);
Marco
精彩评论