Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Handling hideNotify/showNotify  RSS feed

 
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the declaration for a game canvas:

What should I do when the (hide|show)Notify methods are called ?
My game loop currently is doing:-

One possible thing I could do is to stop this GameCanvas thread on reception of hideNotify() and restart the Thread on reception of showNotify().

Another option is to do nothing.

Ideas?
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think do nothing is the good option.. as you cannot stop or pause a gamecanvas thread in hidenotify and restart it in shownotify, can you??
I think AMS itself will pause your midlet.
 
Pho Tek
Ranch Hand
Posts: 782
Chrome Python Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Poonam,

Well I have a reference to the Thread instance. I can interrupt it & set
running to false; that would stop the GameCanvas thread. When I say the GameCanvas, I'm referring to an instance of MyGame; something I have control over.

Thanks

Pho
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!