android自定义对话框

时间:2011-05-18 10:22:04

标签: android dialog customization

我在我的应用中使用自定义对话框。它在大多数情况下都能正常工作。

我使用了customDialog类,如下所示。

 public class CustomizeDialog extends Dialog {
//how much time your popup window should appear
public static int POPUP_DISMISS_DELAY = 0;
private DismissPopup mDismissPopup = new DismissPopup();
public static boolean showDialog  = false;

public CustomizeDialog(Context context, String msg,int POPUP_DISMISS_DELAY) {
    super(context);
    /** 'Window.FEATURE_NO_TITLE' - Used to hide the title */
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    /** Design the dialog in main.xml file */
    setContentView(R.layout.popup);
    CustomizeDialog.POPUP_DISMISS_DELAY = POPUP_DISMISS_DELAY;
            mDismissPopup.start();
            TextView popUpmssg = (TextView) findViewById(R.id.popupmessage);
            popUpmssg.setText(msg);
}



 class DismissPopup extends Thread {
    public void run() {
        SystemClock.sleep(CustomizeDialog.POPUP_DISMISS_DELAY);
        dismiss();
    }
 }

}

当我必须同时显示两条消息时,会出现问题。在这种情况下,第二条消息来自第一条消息。我该如何解决这个问题?请帮帮我。

提前致谢。

1 个答案:

答案 0 :(得分:1)

只显示第一个对话框。 一旦用户点击(触摸)OK按钮显示第二个。

使用“用户界面指南”概念,一次显示两个对话框!

相关问题