Skip to content

Commit

Permalink
Fix #299 如果不设置lifecycleRegistry,会出现空指针
Browse files Browse the repository at this point in the history
  • Loading branch information
zhpanvip committed Feb 14, 2023
1 parent 64807fc commit f46b5c7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,10 @@ public void startLoop() {
if (!isLooping
&& isAutoPlay()
&& mBannerPagerAdapter != null
&&
mBannerPagerAdapter.getListSize() > 1
&& isAttachedToWindow()
&& lifecycleRegistry.getCurrentState() == Lifecycle.State.RESUMED) {
&& mBannerPagerAdapter.getListSize() > 1
&& isAttachedToWindow() && (lifecycleRegistry == null
|| lifecycleRegistry.getCurrentState() == Lifecycle.State.RESUMED
|| lifecycleRegistry.getCurrentState() == Lifecycle.State.CREATED)) {
mHandler.postDelayed(mRunnable, getInterval());
isLooping = true;
}
Expand Down

0 comments on commit f46b5c7

Please sign in to comment.