我正在尝试在 DialogFragment 中实现 ProgressDialog 并将其用作片段。我的 onCreateDialog 看起来像这样:
public Dialog onCreateDialog(Bundle savedInstanceState) {
String message = getArguments().getString("msg");
ProgressDialog dialog = new ProgressDialog(getActivity());
dialog.setMessage(message);
dialog.setTitle("");
dialog.setCancelable(true);
dialog.setIndeterminate(true);
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
return dialog;
}
根据android开发人员的说法,要将这个对话框用作片段,我必须实现onCreateView,它返回视图对象。问题是,我如何获得此类对话框的视图?