I was use a PageAdapter to display a list on each tab of three tabs. When I change the Incoming tab and come back to original tab, the list incomingShiftTrades no load the data from database and throw out a NullPointerException on ShiftTradesIncomingFragment_ when try to do this.models.clear() :
public void setModels(List<ShiftTrade_> models) {
if (models!= null) {
this.models = models;
} else {
this.models.clear();
}
}
/**
* Get the item from the adapter
* @param position
* @return Fragment needed
*/
@Override
public Fragment getItem(int position) {
switch (position) {
case 0:
return ShiftTradesAllFragment_.builder().build();
case 1:
return ShiftTradesIncomingFragment_.builder().build();
case 2:
return ShiftTradesOutgoingFragment_.builder().build();
default:
return null;
}
}
It would be good to test this with the last changes in DecleX, specially after the change introduced by Issue #57, right now Models will never be null.
I was use a PageAdapter to display a list on each tab of three tabs. When I change the Incoming tab and come back to original tab, the list incomingShiftTrades no load the data from database and throw out a NullPointerException on ShiftTradesIncomingFragment_ when try to do this.models.clear() :
Aditional info this is on ShiftTradesFragment:
on ShiftTradesPageAdapter:
on ShiftTradesIncomingFragment: