Allow `ItemBinding` to be null while `List == null`
See original GitHub issueSometimes, you want to perform some initial processing to the list before creating the final OnItemBind
subclass. However, the library will throw an error if ItemBinding
is null.
It would really be helpful if ItemBinding
can be null while the list is still null.
Right now, what we’re doing is providing a dummy ItemBinding
, even though it won’t really be used, since we’ll swap it out with a different implementation anyway once we have a list.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Data binding: set property if it isn't null - Stack Overflow
Well data binding avoids NullPointerException in general by checking for it and assigns the default value (null for example) even if item ...
Read more >databinding ComboBoxAdv NULL value | WinForms Forums
Hi Lan Mo , I am afraid that I was not able to see the issue of 'ComboBoxAdv always display the first item...
Read more >listOfNotNull - Kotlin Programming Language
Returns a new read-only list either of single given element, if it is not null, or empty list if the element is null....
Read more >Layouts and binding expressions | Android Developers
Generated data binding code automatically checks for null values and avoid null pointer exceptions. For example, in the expression @{user.name} ...
Read more >Databinding - data object is null on API 15-18 - Issue Tracker
while setting the dirty flags (which we internally use to control boolean logic), it fails to check whether the field is null. On...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Wouldn’t it be better to clear out the whole adapter in that case? (ex:
recyclerview.setAdapter(null)
).We tried the new PR (#180) and I think it’s fine. No one bothered complaining so I would say, I approve it! The only thing that’s missing now is a note in the README file about the new behavior.
Thank you so much for the quick response and implementation! I’ll be sure to check back for the new release. 🎉