I'm using the MaterialSearchView library. When I search for the first time, the correct elements are returned. If I click on the first result, the correct element is selected and the itemName
is printed out in the logcat. If I search again for another item, the correct elements are again returned but if I select any of the results, the old item is printed (from the previous search) and not the one I have selected.
This is my code:
materialSearchView.setOnItemClickListener((adapterView, view, position, l) -> {
String itemName = itemNames.get(position);
materialSearchView.closeSearch();
Log.d(TAG, itemName);
});
Any ideas? Thanks!