Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can someone explained to me the "paused" state ?

 
Shubhrajit Chatterjee
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have a MIDP enabled device and currently playing around with the J2ME toolkit from sun.
I don't understand how the paused state should be working. In my MIDlet, I implemented a pauseApp()
method and inside it I called notifyPaused() . This happens when the user presses some button on the application.
Now when I am trying to restart the application by calling startApp() method again, it is getting destroyed. ( destroyApp() is getting called )
I think I am making a mistake but it seems that I am not being able to find it out. It wud be nice if someone can point it out to me.
 
Shubhrajit Chatterjee
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did I ask a silly question ??? Or does no one no the answer ???
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a part of an interesting article in case you haven't read it yet:
Lifecycle Methods
 
Eric Giguere
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't call notifyPaused from within pauseApp. pauseApp is called by the system to inform your application that it's being paused. You call notifyPaused outside of pauseApp to tell the system that you're putting the application in a paused state. (Note that pauseApp will not be called in this case -- pauseApp is only called when the system is the one initiating the pause.)
When your application is ready to resume, it calls resumeRequest from a background thread. The system will then (at some undertermined point in the future) unpause the application and call startApp, at which point your app is again active.
See pp.44-47 of "Mobile Information Device Profile for Java 2 Micro Edition".
 
Shubhrajit Chatterjee
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following code is not working as it should

[ February 27, 2002: Message edited by: Shubhrajit Chatterjee ]
 
Shubhrajit Chatterjee
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I click the pause button , the home screen comes up in the emulator with the name of the application. Next, when I try to start it again it says "Application Destroyed" i.e. the message I had coded within destroyApp() method...
 
Eric Giguere
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's up to the device/emulator to decide whether a "pause" button pauses or destroys the application. That's not something covered by the spec. In this case you're seeing it destroy the app.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic