0
Fragmentstateadapter has three builders according to the documentation.
(@Nonnull fragmentActivity: Fragmentactivity)
(@Nonnull Fragment: Fragment)
(@Nonnull fragmentManager: Fragmentmanager,@Nonnull Lifecycle: Lifecycle)
In my class I’m using the first, that way:
class PagerAdapter(val fragmentActivity: FragmentActivity) : FragmentStateAdapter(fragmentActivity) {
...
}
And I hereby instate in Mainactivity:
pager.adapter = PagerAdapter(this@MainActivity)
this@MainActivity which is an Appcompatactivity is passed as parameter, android studio does not point out as error and the app works normally.
The question is my Mainactivity shouldn’t it be a Fragmentactivity? Are there scenarios that I might have some kind of problem with this type of implementation? Remembering that I do not use the fragmentActivity variable within any Pageradapter method.