ViewPager in DialogFragment - IllegalStateException: Fragment does not have a view

后端 未结 4 1706
渐次进展
渐次进展 2020-12-08 07:24

What I want to achieve

  • From a FragmentActivity show a dialog when clicking an Action Button in the Action Bar
  • DialogFragment
4条回答
  •  粉色の甜心
    2020-12-08 07:56

    Use the

    onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
    

    instead of onCreateDialog(Bundle savedInstanceState). Don't create an alert dialog, use the inflater provided by the method, and build your view. It works for me.

    Best regards!

提交回复
热议问题