我需要每当对话框准备DRAWIN更新定制对话框的内容。我不知道这可能是直接刷新或者如果我需要先关闭并重新instatiate呢?
I need to update a custom dialog content whenever that dialog is ready to be drawin. I am not sure this could be refreshed directly or if I need to close it first and re-instatiate it?
获取该对话框使用和[文章]无效的视图。
Get the view that the Dialog is using and [post]invalidate it.
而不是 Dialog.setContentView的(INT)
;
做这样的事情:
public class MyDialog {
View v = null;
public Dialog show(Context context) {
Dialog d = new Dialog(context);
v = LayoutInflater.from(context).inflate(R.layout.resource, null);
d.setContentView(v);
return d.show();
}
public void update() {
v.invalidate();
}
}