Alert

|
Alert มักจะถูกใช้แจ้ง error ให้ user จะให้อยู่นานเท่าไหร่ดู getTimeout()ถ้าได้ Alert.FOREVER แปลวว่าอยู่ไปตลอด มันจะขึ้นมาทับจอเก่า ประกอบด้วย Title, Body, Icon และ Progress bar

สามารถ map Commands เข้ากับ Alart ได้
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;

public class ExampleAlert extends MIDlet {
Display display = Display.getDisplay(this);

public void startApp() {
// Alert(title, text, icon, AlertType)
Alert alert = new Alert("Info", "This is an alert for informative purposes", null, AlertType.INFO);
display.setCurrent(alert);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
}

0 ความคิดเห็น:

แสดงความคิดเห็น