Skip to content

Commit

Permalink
fix调用start开始轮播后可能出现的空指针情况
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouwei committed Jun 5, 2017
1 parent d6c17c8 commit 76f9a2a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mzbanner/src/main/java/com/zhouwei/mzbanner/MZBannerView.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,13 @@ private void initIndicator(){
/******************************************************************************************************/
/**
* 开始轮播
* <p>应该确保在调用用了{@link MZBannerView {@link #setPages(List, MZHolderCreator)}} 之后调用这个方法开始轮播</p>
*/
public void start(){
// 如果Adapter为null, 说明还没有设置数据,这个时候不应该轮播Banner
if(mAdapter== null){
return;
}
if(mIsCanLoop){
mIsAutoPlay = true;
mHandler.postDelayed(mLoopRunnable,mDelayedTime);
Expand Down

0 comments on commit 76f9a2a

Please sign in to comment.