1
0
mirror of https://github.com/TwidereProject/Twidere-Android synced 2025-01-20 20:18:35 +01:00

fixed npe

This commit is contained in:
Mariotaku Lee 2016-02-21 19:23:01 +08:00
parent 6c582e6966
commit 85c8aa931d

View File

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