I'm trying to understand the difference between both classes that are both inner class of TabLayout class. In the following link : example
I see that method onTabSelectedd(TabLayout.Tab tab) in the example, gets a reference to Tab object, and for a reason that i can't understand, it is written there:
ViewGroup vg = (ViewGroup) tabLayout.getChildAt(0);
ViewGroup vgTab = (ViewGroup) vg.getChildAt(tab.getPosition());
is Tab object enough? the way i see the things the second line should return the same object as Tab that it a parameter of the above method. When i'm printing toString() for both objects i see that the parameter tab is instance of TabView and vgTab is instance of Tab Can someone explain me my misunderstanding?