» Nội dung : Một vòng đời MIDlet đã theo các bước ... *.startApp () *.pauseApp () *.destroyApp () Theo mặc định MIDlet là ở các bang bị tạm dừng.khi ứng dụng được thực hiện theo mặc địnhstartApp ()sẽ được gọi.Nhưng khi xây dựng của bạn không phải là loại vô giá trị sau đó nó sẽ được thực hiện trước tiên.Mã nguồn thực hiện vòng đời như sau: import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class MidletLifecycle extends MIDlet{ Form form; Display display; public MidletLifecycle(){ System.out.println("MidletLifecycle constructure"); } public void startApp(){ form =newForm("Midlet Lifecycle"); display = Display.getDisplay(this); String msg ="This is the Lifecycle of Midlet!"; form.append(msg); display.setCurrent(form); } public void pauseApp(){ System.out.println("You are in pauseApp()..."); } public void destroyApp(booleandestroy){ System.out.println("You are in destroyApp()..."); notifyDestroyed(); } } Project:MidletLifecycle.zip
Thông tin
Hiện có 1 đang Online, 1 visit trong ngày,2 visit trong tháng. Tổng lượt truy cập là 761 lượt.