How to join a Tablayout in Activity with a Viewpager within a Framelayout

Asked

Viewed 23 times

0

I am working on a project where I need to join a Tablayout that is on Activity with a Viewpager that is inside a Fragment in the Activity Framelayout.

I’m trying everything, but my brief doubt is: How can I take this Viewpager from Fragment and unite it with Tablayout?

1 answer

0


solved. Unfortunately I was trying to retrieve the code in Activity, being that it was much easier to recover it within Fragment.

I simply made the code below:

! No Fragment !

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

P.S: Kotlin.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.