StackOverflowError when trying to inflate a custom layout for an AlertDialog inside a DialogFragment

后端 未结 3 1288
野趣味
野趣味 2021-02-12 13:50

I\'m trying to create an AlertDialog, by using the Builder and setting a custom view. When I try to inflate the view inside of onCreateDialog, I get a StackOverflowError..

3条回答
  •  星月不相逢
    2021-02-12 14:07

    It looks like this is fixed in Fragment 1.2.3: https://developer.android.com/jetpack/androidx/releases/fragment#1.2.3.

    The docs do use requireActivity().getLayoutInflater() rather than just getLayoutInflater however so it still might not be recommended.

提交回复
热议问题