In my current Android project I use the Butterknife
library to bind views and use onClick
annotations for them. This all works great even in fragments but now I'm at the point where I can't find a solution:
I use the new ToolBar
as ActionBar
and inflate a Menu with a SearchView
in it. For this SearchView
I want to use the @OnTextChanged
annotation but when I call the bind method with the ActionView
of the menu item Butterknife
tries to reinstanciate all Views again and of course in the ActionView
it can not find any other Views of the RootLayout
.
So is there a way to add only one View
with Butterknife
or can I get a View which contains all Views from my RootLayout
and the ToolBarView
so I can pass this View to the bind method? For example in Activites I can call findViewById
also for menu IDs but if I use getView()
from my Fragment it does not work. Any ideas for this?