0

When i click on button in first midlet class i need to redirect to next midlet Class. How to do this

if(sb.toString().equals("SUCCESS")){

              Alert success = new Alert("Login Successfully", 
                      "Your Login Process is completed!", 
                       image, AlertType.INFO);
                    //  success.setImage(image);
                      userName.setString("");
                      password.setString("");
                      display.setCurrent(success, form); 
        // here i move to next midlet       

        } 
Cœur
  • 37,241
  • 25
  • 195
  • 267
User
  • 1,251
  • 1
  • 14
  • 19

1 Answers1

0

If both MIDlets are part of the same MIDlet Suite, then they should be able to launch each other using Class.forName().

Quote from Sun back in the day: "For security reasons, it is assumed that MIDlets within a MIDletSuite are packaged together for a reason and should be able to interoperate. What's implied here is that the MIDlets share a name space; in other words, each MIDlet in the MidletSuite can "see" one another. Because they can see one another, they can launch one another (Class.forName metaphor)."

If the two MIDlets are not part of the same MIDlet Suite, then there is this following trick. I haven't tried it myself though, so it's only theoretical:

For the MIDlet you wish to launch from another MIDlet, you put a PushRegistry entry in the JAD (or register it by code), listening for a socket connection on some port. Then to launch the MIDlet from another MIDlet, you simply create a socket connection on that port using localhost or 127.0.0.1 as address. That should theoretically make the other MIDlet launch.

mr_lou
  • 1,910
  • 2
  • 14
  • 26