08-26-2009 05:25 AM
Hello everybody,
I have an J2ME application for Blackberry which externs Midlet (not UIApplication of Blackberry)
When i press the Red bouton (the call bouton of Blackberry), the appli is in background mode. The pauseApp() de Midlet is invoked, so i can do something when the appli goes in background.
When i presse the menu bouton de blackberry (to able to choose which application i want to put in foreground), i chose my application. And then the application is in foreground. But i have some display problems (the display is blank)
My question is: Which method will be invoked when the appli goes back to foreground ? (so i can do something in this method to force the method repaint())
Thanks for your help.
08-26-2009 05:42 AM
when your app is set in foreground :
public void activate() //function in the main class
when your app is set in background :
public void deactivate() //function in the main class
08-26-2009 06:23 AM
Thanks for your help
But as i said: My application doesn't extern the UIApplication class of Blackberry . It externs the Midlet class. So i can't implement the active() and desactive() methods as you adviced me.
Otherwise, do you know how i can implement theses methods if my application doesn't extern UIApplication ?
Thanks
08-27-2009 03:38 AM
HI, If you are using MIDlet class along witha Canvas then you can make use of showNotify() and hidNotify() of Canvas to take care of background and foreground process.
Thanks & REgards,
Siva Charan Guduru
08-27-2009 03:20 PM
Thanks for your help.
You are right. As a standard J2ME application, it's true. showNotify() and hideNotify() will be invoked automatically.
But i tested on Blackberry Curve (8520) , when the application goes to background (by the red bouton of Blackberry), the pauseApp() is invoked (not hideNotify() method), but when the application goes back to foreground (by the menu bouton of Blackberry), the showNotify() isn't invoked.
However, i found another solution to get around the display problem.
Again one time, thanks for your help.
08-28-2009 02:31 AM
That is very good that you did overcoem the problem, but it would be fine if you post how you have overcoemt he problem so that it will be useful for others as well.
Also are you using low level UI or high level UI in you app, cause if you are using high level UI then showNotify() and hideNotigy() will never be called.
Thanks & Regards,
Siva Charan Guduru