Skip to content

App crash when item removed from recycler view. #1

Description

@KaanRF

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions