App is crashing when item is removed from recyclerview. Because this position not existed anymore and application is brake in isSection
` @OverRide public boolean isSection(int position) {
boolean result = position == 0 ||
getItem( position ).getTransaction().getTimeStamp().getMonth() !=
getItem( position - 1 ).getTransaction().getTimeStamp().getMonth();
return result;
}
@Override public CharSequence getSectionHeader(int position) {
DateFormat dateFormat = new SimpleDateFormat( "MM/yyyy" );
return dateFormat.format( getItem( position ).getTransaction().getTimeStamp() );
}`
Do you have any suggestion how can I avoid that without app crash ?
App is crashing when item is removed from recyclerview. Because this position not existed anymore and application is brake in isSection
` @OverRide public boolean isSection(int position) {
boolean result = position == 0 ||
getItem( position ).getTransaction().getTimeStamp().getMonth() !=
getItem( position - 1 ).getTransaction().getTimeStamp().getMonth();
Do you have any suggestion how can I avoid that without app crash ?