dvdciri / MultiChoiceRecyclerView

Multi choice selection applied on recycler view make life easier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

do not force to set setTitles() in a Builder

hardysim opened this issue · comments

from #28 (comment)

if needed I think the constructor would be a better place

Where am i forcing to set the title?

The MultiChoiceToolbar#Builder() takes setTitles().
If I do not add this to the builder, it crashes with:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference
at com.davidecirillo.multichoicerecyclerview.MultiChoiceToolbar.<init>(MultiChoiceToolbar.java:26)
at com.davidecirillo.multichoicerecyclerview.MultiChoiceToolbar.<init>(MultiChoiceToolbar.java:9)
at com.davidecirillo.multichoicerecyclerview.MultiChoiceToolbar$Builder.build(MultiChoiceToolbar.java:122)

In my understanding, a builder is the thing where I might add options (but I can leave them unset).
Am I wrong?


This is not a bug - more like a architectural discussion ;-)

Correct, thanks for adding info, will fix this later