Skip to content
This repository was archived by the owner on Jul 17, 2020. It is now read-only.
This repository was archived by the owner on Jul 17, 2020. It is now read-only.

Crash when getting the ViewHolder class of a ViewCell that extends a non-generic ViewCell #4

@gantonious

Description

@gantonious

How to recreate:

public class ParentViewCell extends GenericSingleViewCell<ParentViewCell.ViewHolder, Model> { ... }
public class ChildViewCell extends ParentViewCell { ... }

When getViewHolderClass() is called in the ChildViewCell an ArrayIndexOutOfBoundsException will be thrown when trying to access the parametrized type.

The current workaround is to override the getViewHolderClass() method in the subclass:

public class ChildViewCell extends ParentViewCell {
    @Override
    public Class<? extends ViewHolder> getViewHolderClass(int position) {
        return ParentViewCell.ViewHolder.class;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions