FunTabLayout
FunTabLayout copied to clipboard
App Crashes when calling tabLayout.setUpWithAdapter(builder.build())
This is my kotlin code:
val viewPager = findViewById<View>(R.id.viewpager) as ViewPager
setupViewPager(viewPager)
val tabLayout = findViewById<View>(R.id.tablayout) as FunTabLayout
val builder =
BubbleTabAdapter.Builder(this).setViewPager(viewPager).setTabPadding(24, 24, 24, 24)
.setTabIndicatorColor(Color.parseColor("#ffa022"))
.setTabBackgroundResId(R.drawable.ripple).setIconFetcher(this)
.setIconDimension(
50
)
.setTabTextAppearance(R.style.BubbleTabText)
tabLayout.setUpWithAdapter(builder.build())
I have taken this snippet from the demo app in this repo. The error message is
java.lang.IllegalAccessError: Illegal class access: 'com.example.ui.MainActivity' attempting to access 'com.tompee.funtablayout.BaseAdapter' (declaration of 'com.example.ui.MainActivity' appears in /data/app/com.example-nljI2D-kMBoReq4uEtCeFg==/base.apk!classes2.dex)