fixed npe

This commit is contained in:
Mariotaku Lee 2016-02-21 19:23:01 +08:00
parent 6c582e6966
commit 85c8aa931d
1 changed files with 4 additions and 2 deletions

View File

@ -45,8 +45,10 @@ public class ParcelableActivitiesAdapter extends AbsActivitiesAdapter<List<Parce
} }
@Override @Override
public boolean isGapItem(int position) { public boolean isGapItem(int adapterPosition) {
return getActivity(position).is_gap && position != getActivityCount() - 1; int dataPosition = adapterPosition - getActivityStartIndex();
if (dataPosition < 0 || dataPosition >= getActivityCount()) return false;
return getActivity(adapterPosition).is_gap;
} }
@Override @Override