fragments in viewpager, no view found error

前端 未结 8 1177
面向向阳花
面向向阳花 2020-12-19 09:23

I have an activity holding a fragment, in this fragment there is a button , when it is clicked, a dialog is popped out.

In this dialog, there is a Viewpager, which

8条回答
  •  有刺的猬
    2020-12-19 10:20

    The Dialog class is the base class for dialogs, but you should avoid instantiating Dialog directly. Instead, use one of the following subclasses:

    AlertDialogA dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout. And also DatePickerDialog or TimePickerDialog.

    These classes define the style and structure for your dialog, but you should use a DialogFragment as a container for your dialog. The DialogFragment class provides all the controls you need to create your dialog and manage its appearance, instead of calling methods on the Dialog object.

    For more detail please go through Dialog Design

提交回复
热议问题