我有这堂课:
public class FH_TopoDialog extends DialogFragment{
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
/* Options */
this.setCancelable(false);
builder.setIcon(R.drawable.logonofill);
builder.setTitle("Topo Contour");
final CharSequence[] items= {"Stuff"};
builder.setMultiChoiceItems(items, null, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
}
});
builder.setPositiveButton("Done", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.dismiss();
}
});
return builder.create();
}
}
我从我的主要活动中调用它来创建一个对话窗口,我可以在其中获得用户输入,然后在我的应用程序中使用该输入。我怎么来回传递数据?理想情况下,我想将自己的数据结构发送到类中,将其更改并发回。