FragmentManager manager = getFragmentManager();
It is giving the error
required : android:support.v4.FragmentManager
foun
This solved the problem for me for creating fragment with viewpager
.
Make your activity extend AppCompatActivity()
, then use supportFragmentManager
.
abstract class YourActivity() : AppCompatActivity() { /*your Activity Code*/ }
Then, when creating your viewpager
with fragment:
val adapter = ViewPagerAdapter(supportFragmentManager)
viewPager.adapter = adapter
sliding_tabs.setupWithViewPager(viewPager)