https://kotlinlang.org logo
#android
Title
# android
s

Sam Woodall

12/14/2017, 3:31 PM
Hi, has anyone experienced problems with
FragmentPagerAdapter
when overriding
setPrimaryItem()
after updating the support library to version 27.0.0. The signature changed from
setPrimaryItem(container: ViewGroup, position: Int, obj: Any?)
to
setPrimaryItem(container: ViewGroup, position: Int, obj: Any)
. It's causing an illegal argument exception because obj is null.
l

louiscad

12/14/2017, 3:55 PM
Maybe you should post an issue on b.android.com?
p

pdvrieze

12/15/2017, 8:33 AM
While the documentation is a bit vague the concept is that you should return non-null values from instantiateItem. If you return null isViewFromObject will also not work properly.
2 Views