1

I have an activity with BottomNavigationView and 2 fragments that change based on that bottom buttons. (The same situation will be with the drawer setup or ViewPager or any other fragment-based approach)

How do I extract the fragments into separate feature modules?

The problem that I face is that my main activity, than contains the BottomNavigationView, needs to know about the fragments to instanciate them.

TpoM6oH
  • 8,385
  • 3
  • 40
  • 72

1 Answers1

0

For instant apps you need to have an addressable Activity to download and launch a new feature module. On the other hand you could use dynamic feature modules and instantiate the Fragment via reflection after it's hosting module has been downloaded via the PlayCore API.

Ben Weiss
  • 17,182
  • 6
  • 67
  • 87