3

I am using AutoCompleteTextView and here i want to show the list of filterable data in RecyclerView not in the ListView.

arps
  • 49
  • 3
  • RecyclerView need an custom adapter, though you can do it inside the staic class view holder , i hope it would be buggy. – EngineSense Aug 31 '16 at 09:14

2 Answers2

0

This is not possible.

RecyclerView is a view on its own. Since your AutoCompleTextView only has to do with the String data in it, you can't use something like a RecyclerView Adapter.

Stefan
  • 2,098
  • 2
  • 18
  • 29
  • since AutoCompleteTextView only uses either BaseAdapter or ArrayAdapter which results the hint of data to come in ListView.Do you know what can be done for showing those hints in RecyclerView from AutoCompleteTextView – arps Sep 01 '16 at 04:58
0

A roundabout option is to implement a SimpleAdapter subclass that wraps the RecylerView.Adapter you are using. There is some example code of that here: https://stackoverflow.com/a/42701792/1686615 .

Then an AutoCompleteTextView can use your SimpleAdapter wrapper to show the same data / views that you would show in a RecyclerView.

Community
  • 1
  • 1
leorleor
  • 554
  • 5
  • 14