Coder Social home page Coder Social logo

Comments (2)

jonathanyee avatar jonathanyee commented on June 20, 2024 2

Thanks this fixed it. Completely overlooked the equals method.

from flexibleadapter.

davideas avatar davideas commented on June 20, 2024

Hello @jonathanyee, I think the mistake is in the Override of the equals method, it is not correctly implemented, the cast to String is never done because the o is an instance of RecentContactHeaderItem, so you should do something like this if you want to check the title:

@Override
public boolean equals(Object o) {
    if (o instanceof RecentContactHeaderItem) {
        RecentContactHeaderItem  oo = (RecentContactHeaderItem ) o;
        return oo.title.equals(this.title);
    }
    return false;
}

Pay attention to the null values.
Same mistake for RecentContactItem.

Have a look at this page Writing a correct equals method to implement your own equals method.

I've put it mandatory to implement, because in most cases we identify the items with our "id", otherwise the basic implementation is return o == this, you can also use it.

I'm working on expandable sections that are also a Header. However I've committed already something in dev yesterday evening, But I did not yet created a new snapshot, I'll do it very soon. The adapter needed a tiny modification internally.

from flexibleadapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.