I followed the official documentation to setup a TabLayout with ViewPager2. I used the TabLayoutMediator this way to connect the TabLayout with the ViewPager2:
Your mContext, being exposed by RouteActivity is lingering around even after RouteActivity is destroyed (or recreated). This is happening probably because something is using it. Track what is using mContext and stop that.