The Android Developer Challenge is back! Submit your idea before December 2.

OnAdapterChangeListener

interface OnAdapterChangeListener
androidx.viewpager.widget.ViewPager.OnAdapterChangeListener

Callback interface for responding to adapter changes.

Summary

Public methods

abstract Unit
onAdapterChanged(@NonNull viewPager: ViewPager, @Nullable oldAdapter: PagerAdapter?, @Nullable newAdapter: PagerAdapter?)

Called when the adapter for the given view pager has changed.

Public methods

onAdapterChanged

abstract fun onAdapterChanged(@NonNull viewPager: ViewPager, @Nullable oldAdapter: PagerAdapter?, @Nullable newAdapter: PagerAdapter?): Unit

Called when the adapter for the given view pager has changed.

Parameters
viewPager ViewPager: ViewPager where the adapter change has happened
oldAdapter ViewPager: the previously set adapter
newAdapter ViewPager: the newly set adapter