Search code examples
javajava-memidp

How to use platformRequest to call a website Url?


I am making a j2me website launcher for an url "http://www.google.com".

I am using this code:

public class LuncherMidlet extends MIDlet {
    boolean Isflage;
    public void startApp() {
        Isflage = false;
        try {
            Isflage = platformRequest("http://www.google.com");
        } catch (ConnectionNotFoundException ex) {
            ex.printStackTrace();
        }
        if(Isflage){
            destroyApp(true);
            notifyDestroyed();
        }
    }
    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    }
}

This code is working fine, but when I try to close the browser of mobile it shows a message for connect to server. If I say no then it again open the this j2me launcher again. It's not exiting from mobile browser. My launcher reaches in a loop.
Kindly suggest me on this issue.


Solution

  • When you invoke platformRequest(), it would call to native apps, and on close on browser it is browser's stuff that is being invoked. You can't change it.