Such a situation, using Filterable , during the search, first used the Activity , but then it was necessary to use a fragment. I will not go into the structure of the code, but the method call occurs in the custom adapter.

 @Override public Filter getFilter() { return ((MainActivity) mContext).new ListFilter(); } 

This code is located in the adapter when I use the Activity , but if I use a fragment, I can’t understand how I can redo this method so that it works correctly. And yes, ListFilter() is an inner class that inherits from Filter . How do I implement a similar method in the fragment?

  • one
    so what's the problem, the context can not pick up? - ermak0ff 7:09
  • Yes, as I just did not set this context)) - DemD10

0