J2ME: Do not close app when phone closed..

          WHAT I WANT: When my application is running....I want to come back to the same state when I open the phone after closing for sometime.

          WHAT I DID: When my application is running------If I close the phone using ExternalDisplayCanvas and display a text in the screen (phone: Motorola i870).....and open the phone, application is not closed..I want exactly like this but I had to display something on the screen to do this..which I do not want.
          But When I do not use ExternalDisplayCanvas and close the phone..app will be closed...

          WHAT I AM DOING RIGHT NOW: I am trying to do with pushRegistry but it became too complicated...is the pushRegistry only way to do it??Am I in the right track?

Any help or insight would be appreciated..

Who is Participating?
sreenathkConnect With a Mentor Commented:

 U have to use the Java suspension state. Suspend java and resume wneh u come next time.  Using this it is possible.

khamoudaConnect With a Mentor Commented:

Hi velosumdev !

I am not sure if I understood your question correctly, but if you switch off the phone completely, it means the application have been closed completely as well. In that case, to reopen it again automatically, you have to use the PushRegistryAlarm to set the alarm ( and also to set some paramters to know your current status for the next open )in the closeApp() Abstract class in the MIDlet, in that case it may :

1- for SonnyEricsson, when you switch on again, it will prompt you to start the application ( you have to permit manually - if your application is not signed ) , in that case you can do whatever you want with the above set parameters

2- for Nokias , the setAlarm will be lost, you have to reopen the application manually

Not sure what is the behaviour of motorola

I wish that helps

khamoudaConnect With a Mentor Commented:

wasnt this helpful ? or I didnt understand your question ?

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.