Why Is It Necessary To Implement Onfragmentinteractionlistener When Setting Up A Fragment?
I followed the official documentation: https://developer.android.com/guide/components/fragments#Creating. It provides the steps to set up a fragment. First, create the fragment cl
Solution 1:
I'm pretty sure in the Fragment's onAttach method, it will say that the parent activity must implement the OnFragmentInteractionListener. This is to facilitate Fragment to Activity communication.
This is not required and the check in onAttach can be removed. In fact if you are not doing anything in the onAttach method then the whole method can be removed from the Fragment
Post a Comment for "Why Is It Necessary To Implement Onfragmentinteractionlistener When Setting Up A Fragment?"