我有一个简单的程序来显示一个对话框,其中包含一个edittext视图,并且收听正/负按钮,以在每个对象中执行自定义操作(读取该编辑文本并将其内容保存到一个活动变量)。
当我看不到任何方法从对话框界面恢复当前对话框(然后我无法恢复对话框中的任何视图)出现问题。
可能这是一个noob的问题,但经过一些谷歌搜索,我没有一个答案。
我的代码如下
LayoutInflater li = LayoutInflater.from(this);
View myView = li.inflate(R.layout.my_layout, null);
AlertDialog.Builder cDialog = new AlertDialog.Builder(this);
cDialog.setView(myView);
cDialog.setPositiveButton(R.string.start_download, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//here the code to retrieve dialog
}
});
cDialog.create();
任何关于我在哪里可以找到的线索?