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
New Developer
Posts: 8
Registered: ‎08-21-2008
My Device: Not Specified

setDisplay(null) to get midlet to run in background, why?

[ Edited ]

Overview

To properly run my midlet in the background on pausApp, I need always setDisplay to null. The code looks like this:

 

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

 

If i do not set display to null, then the background thread of my application doesn't seem to run (the application really does pause).

 

Question

So this solution works great, but I'm curious to know why it works? Why must I set display to null for the application's background thread to run on pauseApp?

Message Edited by AtariPete on 09-24-2008 01:23 AM
BlackBerry Development Advisor
Posts: 15,128
Registered: ‎07-09-2008
My Device: BlackBerry Passport
My Carrier: Bell

Re: setDisplay(null) to get midlet to run in background, why?

MIDlets do not support background processing.  So it should be expected that a MIDlet is paused when it is not in the foreground.
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