Skip to content Skip to sidebar Skip to footer

Valueeventlistener Not Working As Expected

I am trying to display the data stored in Firebase, in AutoCompleteTextView's Dropdown. For this purpose, I am using the ValueEventListener. According to the documentation of Value

Solution 1:

I think I understood the problem. To make it work, I will have to move the following lines of code outside the For loop

ArrayAdapter<String> adapterAutoComplete = newArrayAdapter<>(getActivity(), android.R.layout.simple_list_item_1, tagList);
actv_tagName.setAdapter(adapterAutoComplete);

When inside the For loop, the adapter gets updated for every loop. Placing the above code outside For loop, overcomes the issue.

Post a Comment for "Valueeventlistener Not Working As Expected"