1

Here is my Single Activity Approach:

MainActivity has the NavHost

MainFragment with AppBarLayout, TabLayout, ViewPager, etc.

MainFragment Has 2 (or more) Fragments within ViewPager -> {

CustomerListFragment -> will navigate to CustomerDetailFragment

EmployeesListFragment -> will navigate to EmployeeDetailFragment

}

CustomerDetailFragment (has completely different design layout)

EmployeeDetailFragment (it also has completely different design layout)

* My Problem is that, How I am going to handle Navigation Between these List Fragments to Detail Fragments with Navigation Architecture Components(androidx)*

Riajul
  • 1,140
  • 15
  • 20

1 Answers1

1

Say you are in Fragment A with a ViewPager of Fragment B And you try to navigate from B to C

Since in the VieWpager the fragments are not a destination, your graph wouldn't know you are on B.

A solution can be to use ADirections in B to navigate to C

AntPachon
  • 1,152
  • 12
  • 14