Display.getDisplay(this).setCurrent(null);索爱测试通过
- import javax.microedition.io.PushRegistry;
- import javax.microedition.lcdui.*;
- import javax.microedition.midlet.MIDlet;
- import javax.microedition.midlet.MIDletStateChangeException;
- public class mid extends MIDlet implements CommandListener
- {
- Command micmd;
- Form f;
- public mid()
- {
- // TODO Auto-generated constructor stub
- f=new Form("最小化测试");
- micmd=new Command("最小化",1,1);
- f.addCommand(micmd);
- f.setCommandListener(this);
- Display.getDisplay(this).setCurrent(f);
- }
- protected void destroyApp(boolean arg0) throws MIDletStateChangeException
- {
- // TODO Auto-generated method stub
- }
- protected void pauseApp()
- {
- // TODO Auto-generated method stub
- Display.getDisplay(this).setCurrent(null);
- }
- protected void startApp() throws MIDletStateChangeException
- {
- // TODO Auto-generated method stub
- }
- void a()
- {
- Display.getDisplay(this).setCurrent(null);
- }
- public void commandAction(Command c, Displayable arg1)
- {
- // TODO Auto-generated method stub
- if(c==micmd)
- {
- a();
- // pauseApp();
- }
- }
- }
可以看到写在pauseApp()和普通方法中的效果是一样的