I am building an application that (among many other things) will (hopefully) auto-complete single words and bigrams that users enter in an AutoCompleteTextView from a custom-built dictionary with a Patrica Trie data structure. As of now, my application searches the dictionary and returns autocompletions just fine, however I am having problems updating the auto-completions.
I began with an ArrayAdapter and just reset the adapter everytime I got new completions. However, that happens multiple times per second (as the user types), and somewhere in that mayhem the completions or something (I'm not even sure what) get overwritten and somehow I get a NullPointerException within the Android code (I can't see it).
So, my question is, how can I build an autocomplete that updates seamlessly multiple times per second without using a content provider or a database? Ideally the implementation and functionality will be similar to the AutoComplete4.java (sorry it wont let me post a link) the API Demos. Can I build my own extension of a Cursor and use that with my own CursorAdapter? And how do I do that?
Any help is GREATLY APPRECIATED, and if more info is needed I am more than happy to supply it. Any links, suggestions, ideas, confusions... THANKS in advance!!