Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 146
Registered: ‎07-24-2008
My Device: none
My Carrier: none

Issue in PauseApp/StartApp

Hi All

I have a MIDlet application. In this application while navigating in the application , repaint is called in a Thread which loads thumbnail images and repaints the screen in a loop. My Problem is while this process if we press the back key (I have handled the back key to send the application in background , by seting current display null, and caling requestBackground()), the startApp() is get called and pauseapp is called after some time.

I am not sure Why the startApp is invoking, .

Any body any idea .

Waiting for reply

Ankit 

 

 

Thanks & Regards,
Ankit Dubey
Module Lead Software Engineer, mLabs
Impetus InfoTech (India) Pvt. Ltd.
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Issue in PauseApp/StartApp

By back key do you mean the red End (phone call) key or the escape key (arrow)?  Are you calling the Application.requestBackground() method?  This method should only be used by BlackBerry CLDC applications, not by MIDlets.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 146
Registered: ‎07-24-2008
My Device: none
My Carrier: none

Re: Issue in PauseApp/StartApp

HI

By back key i mean escape key.Also i put the requestBackground() , to overcome this problem, it was there before using this method.

Is there any scenerio where startApp() may called before pauseApp() while putting application in to background.

Waiting for your reply

Ankit 

Thanks & Regards,
Ankit Dubey
Module Lead Software Engineer, mLabs
Impetus InfoTech (India) Pvt. Ltd.
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Issue in PauseApp/StartApp

MIDlet applications do not support background processing.  What you are trying to do is not supported.  You can do this with a BlackBerry CLDC application.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 70
Registered: ‎08-18-2008
My Device: Not Specified

Re: Issue in PauseApp/StartApp

>> MIDlet applications do not support background processing.  What you are trying to do is not supported.  You can do this with a BlackBerry CLDC application.

 

Mark, I thought MIDlets *can* still run in the background? I'm using JDE 4.3.0 r1 with a 8130 handset, and I can see that when I hit the "red hang up button", my background threads are still running. I'm just printing out a statement to debug every 5 seconds forever, and it seems to work. Am I just getting lucky?

 

I read some posts on this board which suggested doing this in pauseApp():

 

    private Displayable displayable = null;
   

    public void pauseApp()
    {

        Display display = Display.getDisplay(this);
        displayable = display.getCurrent();
        display.setCurrent(null);

    }

 

    public void startApp()

    {

         // If we're being resumed...

         display.setCurrent(displayable);

    }

 

yeah so my background thread runs forever even though I'm not the foreground app anymore. Can you give me any info on this?

 

Thanks