How to implement OnFragmentInteractionListener

后端 未结 12 2677
花落未央
花落未央 2020-11-22 06:25

I have a wizard generated app with navigation drawer in android studio 0.8.2

I have created a fragment and added it with newInstance() and I get this error:

12条回答
  •  爱一瞬间的悲伤
    2020-11-22 07:09

    For those of you who visit this page looking for further clarification on this error, in my case the activity making the call to the fragment needed to have 2 implements in this case, like this:

    public class MyActivity extends Activity implements 
        MyFragment.OnFragmentInteractionListener, 
        NavigationDrawerFragment.NaviationDrawerCallbacks {
        ...// rest of the code
    }
    

提交回复
热议问题