我遇到与此问题有关的问题Starting DialogFragment from a class extending RecyclerView.ViewHolder。
我已经尝试了解决方案,我遇到了getSupportFragmentManager()
方法的错误。
Error:(147, 15) error: no suitable method found for
show(android.support.v4.app.FragmentManager,String)
method DialogFragment.show(android.app.FragmentManager,String) is not applicable
(argument mismatch; android.support.v4.app.FragmentManager cannot be converted to android.app.FragmentManager)
method DialogFragment.show(FragmentTransaction,String) is not applicable
(argument mismatch; android.support.v4.app.FragmentManager cannot be converted to FragmentTransaction)
答案 0 :(得分:0)
您需要从android.support.v4.app.DialogFragment扩展对话框片段类,而不是从android.app.DialogFragment
扩展