开发者

setting gauge in alert box in symbian

开发者 https://www.devze.com 2023-01-07 03:53 出处:网络
I want to set gauge object in Alert to show the progress but it is giving java.lang.IllegalArgumentException

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

0

精彩评论

暂无评论...
验证码 换一张
取 消