0

I am using the Navigation Graph, and in one section of my app I want to use a BottomNavigationView in a fragment to navigate between three fragments, but I am getting an error: 'must implement OnFragmentInteractionListener'. The error says I should implement it in the activity but the BottomNavigationView is only for a section of the application.

1) Is this a pattern which does not work? I have seen a number of examples where the BottomNavigationView is for the whole application.

2) Do people ever have 2 activities in an app, each with their own Navigation Graph? Example: one for configuration which requires multiple screens and one for a run mode which also requires multiple screens.

3) Maybe I should have 2 BottomeNavigationView's, where only one is visible/enabled at a time depending on the mode (configure/run)?

Hoping for some feedback on which option might be best, or maybe there is an option I did not consider.

lcj
  • 1,355
  • 16
  • 37

1 Answers1

1

Sounds like you copy/pasted some code / left in part of some auto-generated sample code. If you're not using the OnFragmentInteractionListener interface, just remove that code.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443