lunedì 12 ottobre 2009

Check if a J2ME application has been sent to background correctly

Some device allow to put a J2ME application in background with this piece of code:
display.setCurrent(null);

To check if the cal was succesfull, we can use the isShown() method of the class displayable. So if m_disp is your displayable you can use:

if ( m_disp.isShown() ) {
    // method didn't work
 }
 else {
    // app is in background
 }

Nessun commento:

Posta un commento