In the application has toolbar and 2 tabs through TabLayout with 1 fragment on each tab.
I want to put the library MaterialSearchView to implement SearchView that will be done by researching the items that are in recyclerview TAB phones.
But I put MaterialSearchView in activity_main.xml
<com.mancj.materialsearchbar.MaterialSearchBar
style="@style/MaterialSearchBarLight"
app:mt_speechMode="false"
app:mt_hint="Pesquisar telefones"
app:mt_maxSuggestionsCount="10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/searchBar" />
When I try to use MaterialSearchBar through the null point exception fragment.
I have to put the MaterialSearchBar in the xml of the fragment or have some way of use in activity xml?