⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 midletlifecycle2.java

📁 java手机程序开发光盘源码(第四章)
💻 JAVA
字号:
import javax.microedition.midlet.*;

public class MIDletLifeCycle2 extends MIDlet{

	boolean everPaused = false;

	public MIDletLifeCycle2(){
		
		System.out.println("MIDletLifeCycle is initialized!");
	}

	public void startApp(){
		
		if(!everPaused){	
			System.out.println("startApp() is called!");
			pauseApp();
			notifyPaused();
			resumeRequest();
		}
		else{
			System.out.println("startApp() is called twice!");
			destroyApp(true);
			notifyDestroyed();
		}
	}

	public void pauseApp(){
		
		everPaused = true;
		System.out.println("pauseApp() is called!");
	}

	public void destroyApp(boolean unconditional){
		
		System.out.println("destroyApp() is called!");
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -