I am using @BindString from ButterKnife 7.0 in a helper class that don't have any view.
The bind methods from Butter Knife are:
bind(Activity target)
bind(View target)
bind(Dialog target)
bind(Object target, Activity source)
bind(Object target, View source)
bind(Object target, Dialog source)
As you can see, there are no method that allow me to do the bind without a View object.
I can get any activity and pass it to the class to make the bind, but this is hacky and will add an unnecessary dependency to my class.
There is any way to make Butter Knife binding without a View?
To access (string) resources you need a Context
. A View
has a reference to the context
that created it.
I don't see how you can bind a string without a context
.
Update: See this issue on Github