How to implement databinding with Reflection in BaseFragment()
问题 I'm trying to implement a BaseFragment in which I will pass the layout resource on it and it should outputs the binding to work in the fragment itself instead of need to do it everytime the fragment is extended. For example I have this BaseFragment open class BaseFragment(@LayoutRes contentLayoutId : Int = 0) : Fragment(contentLayoutId) { private lateinit var onInteractionListener: OnFragmentInteractionListener val toolbar : Toolbar? get() { return if(activity is BaseActivity) (activity as