How to join a TabLayout in activity with a ViewPager within a FrameLayout

0

I'm working on a project where I need to join a TabLayout that is in activity with a ViewPager that is inside a fragment in the Activity FrameLayout.

I'm trying everything, but my short question is: How can I get this ViewPager from fragment and merge it with TabLayout?

    
asked by anonymous 17.11.2017 / 21:08

1 answer

0

resolved. Unfortunately I was trying to recover the code in the activity, and it was much easier to recover it inside the fragment.

I simply made the following code:

! No Fragment!

mainTabs = activity.findViewById(R.id.main_tabs)
mainTabs.setupWithViewPager(mPager, false)

P.S: Kotlin.

    
17.11.2017 / 21:46