from the doucment . i got know the method Display.setCurrent( nonNullDIsplayable) can send a background midlet to foreground . but in my practice .it didn't work well . what happend like this :
there is one backgroud thread hold a tcp connection in my midlet .there is two type msg come in . one is Type A .and another is B.
when my midlet rcv the Type A msg, it excute <code>Display.setCurrent( Form a )</code> .and when the Type B msg come .the midlet will excute <code>Display.setCurrent( Form b )</code>.
the problem is :
when two type A msg come in .then double excute the <code>Display.setCurrent( Form a )</code> . the midlet will be sent to the forground .
But when type B msg come in the .<code>Display.setCurrent( Form b )</code> is excuted . the midlet always in the background ..not sent to the foreground .
and after i do some search on this topic . i got know the AMS will not invoke the Midlet . pauseApp() .except added a jad property like : nokia-back-event: pause . so i follow the doucument 's guard . add this property in the jad .and try to use the method <code> midlet.resumeRequest()</code> to take the backgound midlet to forground .
but what happed let me sad .it's true the AMS invoke the pauseApp() and also invoke the s midlet.startApp() after excute the <code> midlet.resumeRequest()</code> .but the midlet always stay in background . and then i switch the backgroud midlet to the foreground by manually . i found the AMS don't invock the midlet.startApp() when foreground the midlet