question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

adapter.getModelById() not working.

See original GitHub issue

Create model in bindModels() :

MediaItemView.Model(thmPath, clickListener)
                                .id(101L)
                                .addTo(this)

Try to access by id: adapter.getModelById(101L)

Which is not working probably due to

  public EpoxyModel<T> id(Number... ids) {
    long result = 0;
    for (Number id : ids) {
      result = 31 * result + hashLong64Bit(id.hashCode());
    }
    return id(result);
  }

Am I missing something?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
elihartcommented, May 22, 2018

if you need the model on click you should use https://github.com/airbnb/epoxy/wiki/Epoxy-Models#click-listeners

0reactions
gevariya-ajitcommented, May 22, 2018

Thank you @elihart, Implemented that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

user.get(position).getId() is not working - Stack Overflow
I am using getId() in model class but it is returning null. enter image description here public class Users { String username; String...
Read more >
RecyclerView.Adapter - Android Developers
Unlike ListView adapters, types need not be contiguous. Consider using id resources to uniquely identify item view types.
Read more >
Customizing Adapters - Ember Data
In Ember Data, an Adapter determines how data is persisted to a backend data store. Things such as the backend host, URL format...
Read more >
Using the RecyclerView | CodePath Android Cliffnotes
Overviews. The RecyclerView is a ViewGroup that renders any adapter-based view in a similar way. It is supposed to be the successor of...
Read more >
Epoxy Controller · airbnb/epoxy Wiki - GitHub
addTo(this); } new LoadingModel_() .id("loading model") . ... all of your data access is thread safe - Epoxy does not help you with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found