我有这个自定义对话框:
public class MyProgressDialog extends Dialog {
public MyProgressDialog(Context context) {
super(context);
}
public static MyProgressDialog show(Context context) {
MyProgressDialog dialog = new MyProgressDialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.progress);
dialog.getWindow().setBackgroundDrawableResource(
android.R.color.transparent);
dialog.show();
return dialog;
}
public static void dismiss(Context context) {
MyProgressDialog dialog = new MyProgressDialog(context);
dialog.dismiss();
}
}
它会显示
protected void onPreExecute() {
MyProgressDialog.show(ItemsActivity.this);
}
但不会解雇:
MyProgressDialog.dismiss(ItemsActivity.this);
有谁知道为什么?