我的对话框有问题。我想做类似安装的表格,询问输入/选择选项的问题。此时做了一个简单的对话框,显示带有微调器的布局。任何想法我应该怎么做才能在“下一步”按钮上创建新对话框(或者可能以某种方式更改当前对话框的布局?)问下一个问题?
图片:
我的代码:
public class Dialog_box extends SherlockDialogFragment
{
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
final LayoutInflater inflater = getActivity().getLayoutInflater();
builder.setView(inflater.inflate(R.layout.my_layout, null));
builder
.setTitle("Question I")
.setPositiveButton(R.string.next, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
}
});
return builder.create();
}
}