开发者

Change display in form to another form in j2me

开发者 https://www.devze.com 2023-04-05 18:33 出处:网络
I get trouble when I created one form and one midlet and I want thro开发者_JAVA百科ugh an alert for user when user enters detail, but I got trouble it can\'t change screen to show alertnothing can be

I get trouble when I created one form and one midlet and I want thro开发者_JAVA百科ugh an alert for user when user enters detail, but I got trouble it can't change screen to show alert


nothing can be easier with the code provided in rev 4 of your question

// ... your AddReview class

    public AddReview(String title, MainFoodie mf) {
        super(title);
        this.mf = mf; // without that you'll get NPE in changeSreen
        // ...
    }

    //...
    private void changeScreen(Alert a, Form f){
        Display.getDisplay(mf).setCurrent(a, f);
    }

    public void commandAction(Command c, Displayable d) {
       if(c.getLabel().equals("Save")){
           // how to show alert here:
           changeScreen(cfmAlert, this)
       }
0

精彩评论

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

关注公众号