Skip to content Skip to sidebar Skip to footer

Android -- Autocompletetextview Dropdown Question

So here's my issue. String[] list = ws.getList() ///returns a String[] of 2900 elements. AutoCompleteTextView actv= (AutoCompleteTextView)findViewById(R.id.field); ArrayAdapter

Solution 1:

I have an autocompletetextview in an app i'm developping that has about 5000 entries and it works fine. However, it is significantly slow on a real device without debugging set to true. So if you run it in the emulator it is very likely that you are not seeing anything as it would take a long long type to perform filtering and then display the suggestions.

To my knowledge, there is no limit on the numbers of item

Solution 2:

I'm having the same issue. I've been running a lot of tests to try slim down the problem.

I'm using an xml file to supply the array to my autocomplete field. In 2.2 the activity crashes when the array is too large. In 2.3 the same array doesn't cause any issues at all.

My array consists of around 950 nodes. Once I slim it doen to about 200 it's fine. (I didn't note the exact number that causes a crash.)

Solution 3:

I had a similar issue but some of my Strings were null or empty, because the data was pulled from an unfamiliar database. I created my list like this and it works just fine. The empty or null strings in the list prevent the dropdown from opening.

if(mystring!=null && !mystring.isEmpty()) { //add to list here }

Maybe your test of 30 is working because you know each string has a value. I did a similar test and found that it worked, which led me to the solution/idea above... two years later... I wonder if he's still stuck on this problem ;)

Post a Comment for "Android -- Autocompletetextview Dropdown Question"