Hi, can anyone tell me how to call another form in Java MIDlet?
I'm trying to make 2 seperate java midlet, the main form
will call or show the second java midlet, but i dont know
what function or code to use. Is this even possible or
i just have to use inheritance and extends? thanks.
5 replies to this topic
#1
Posted 20 August 2011 - 04:35 PM
|
|
|
#2
Posted 22 August 2011 - 10:35 PM
To load one form from another, you use the setCurrent() method of the Display class.
OBDMobile http://sites.google....te/obdiimobile/
#3
Posted 23 August 2011 - 01:38 AM
ok i'll try that, but i think that method is only used for java applet
hope that also work for midlets.
hope that also work for midlets.
#4
Posted 23 August 2011 - 03:19 AM
If you check the link in my signature, you'll see that I have an OVI store app written in J2ME. what I told you is how you do it. It has nothing to do with applets.
OBDMobile http://sites.google....te/obdiimobile/
#5
Posted 23 August 2011 - 08:18 AM
i tried get display.getDisplay() and .setCurrent() method but it doesnt work
i'm having an error and it says "java.lang.SecurityException: Application not authorized to access the restricted API"
btw heres my code:




where part1-3 is my main midlet and part4.jpg is the second midlet that i want to display after selecting "Acceleration in the menu list(main form)".
the codes is in part2.jpg in the public void testItem1() function. can you tell whats wrong?
thanks.
i'm having an error and it says "java.lang.SecurityException: Application not authorized to access the restricted API"
btw heres my code:




where part1-3 is my main midlet and part4.jpg is the second midlet that i want to display after selecting "Acceleration in the menu list(main form)".
the codes is in part2.jpg in the public void testItem1() function. can you tell whats wrong?
thanks.
#6
Posted 23 August 2011 - 10:09 PM
Your problem is that you're trying to start one midlet from another. One application, one midlet. Make your Acceleration class extend Form, instead. Then when you want to display that form, just do it from your first midlet.
Your main meny midlet displays its form, then when you want to change screens, just setCurrent(accel) the next screen (form).
Your main meny midlet displays its form, then when you want to change screens, just setCurrent(accel) the next screen (form).
OBDMobile http://sites.google....te/obdiimobile/
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









