custom-arrayadapter

Kotlin AutoCompleteTextView Adapter Item Selected Giving Different Value

只愿长相守 提交于 2020-12-31 05:52:08
问题 So I am working with Kotlin on this project, I mainly use Java so I'm trying to find equivalents in Kotlin to achieve the same functionality. I am getting a JSONArray from my Database and storing it in a Serializable data class called Congregation it has the following variables id: Int, name: String, language: String I now have a registration activity in which there is a "Congregation" input, I decided to make this an AutoCompleteTextView so that I could suggest possible values matching what

Filter data by input in custom ArrayAdapter displays empty items

我怕爱的太早我们不能终老 提交于 2019-12-11 06:17:25
问题 I implemented EditText widget to filter items in ListFragment using custom ArrayAdapter . It works fine but the filtered list contains EMPTY items as well as filtered items. I found that i should clear the adapter before to repopulate it, right? Could it be something like adapter.clear(); listview.getAdapter().notifyDataSetChanged(); Anyway I cannot find working solution. Any clue to fix this bug, please? public class CustomListAdapter extends ArrayAdapter<UnitView> { private static final