I have a pager and on the same fragment a button to change the theme, when i change it with AppCompatDelegate.setDefaultNightMode(...)
It crashes, it only happens in android 12
This is the error i'm getting:
java.lang.NullPointerException
at com.tbuonomo.viewpagerdotsindicator.BaseDotsIndicator.isNotEmpty(BaseDotsIndicator.kt:308)
at com.tbuonomo.viewpagerdotsindicator.BaseDotsIndicator$setViewPager2$2.isNotEmpty(BaseDotsIndicator.kt:258)
at com.tbuonomo.viewpagerdotsindicator.BaseDotsIndicator.refreshOnPageChangedListener(BaseDotsIndicator.kt:156)
at com.tbuonomo.viewpagerdotsindicator.BaseDotsIndicator.access$refreshOnPageChangedListener(BaseDotsIndicator.kt:20)
at com.tbuonomo.viewpagerdotsindicator.BaseDotsIndicator$refreshDots$1.run(BaseDotsIndicator.kt:151)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7822)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
I'm using the 4.2 version of this library.
I have a pager and on the same fragment a button to change the theme, when i change it with
AppCompatDelegate.setDefaultNightMode(...)
It crashes, it only happens in android 12This is the error i'm getting: