Yes it's null. You have to specify one: http://developer.android.com/reference/android/widget/CursorAdapter.html#setFilterQueryProvider(android.widget.FilterQueryProvider)
The FilterQueryProvider is a mechanism to let you filter the cursor without subclassing CursorAdapter. So either you extend CursorAdapter and override runQueryOnBackgroundThread() *or* you supply a FilterQueryProvider. On Tue, Feb 24, 2009 at 8:47 PM, Will <[email protected]> wrote: > > I have an AutoCompleteTextView that really, really appears to be > working. I type and the list pops down as text begins to match what I > type, eventually the user can select what he wants and the appropriate > value gets passed to the next activity. My adapter is an extended > CursorAdapter, not an ArrayAdapter. > > My runQueryOnBackgroundThread(CharSequence constraint) takes the > constraint and passes it to my own function which does a SQL search > for the constraint.toString() and returns a Cursor with the > resultset. If the user types in "dog" every row in the table with > "dog" a certain column shows up in the dropdown box. This is exactly > what I intend. > > The issue is that I cannot get a query from FilterQueryProvider(). In > fact, calls to getFilterQueryProvider() return null in all cases that > I have seen. However, the SDK entry on runQueryOnBackgroundThread > states, "The query is provided by a FilterQueryProvider. If no > provider is specified, the current cursor is not filtered and > returned." The sample code I have seen appear to implement this too. > > Since my various calls to getFilterQueryProvider() return null I can > only assume no provider is specified and return an ununfilterd cursor > (7000+ rows), but my constraint plainly has good data in that should > not be ignored. And getFilterQueryProvider() returns null in all > cases I have tried. > > getFilter does return a Filter > I do extend CursorAdapter and implement Filterable in my class > > Since I am new I suspect I'm missing something and my emulator will > combust any minute. Am I missing something or is this a documentation > error? > > > -- Romain Guy Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

