• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

cursoradapter problem

sugna

Lurker
hi guys, i got stuck in a snippet i found.
couldn't understand what the heck is going on.
codes below:
=====
public Cursor runQueryOnBackgroundThread(CharSequence constraint)
{
if (getFilterQueryProvider() != null)
{
return getFilterQueryProvider().runQuery(constraint);
}

StringBuilder buffer = null;
String[] args = null;
if (constraint != null)
{
buffer = new StringBuilder();
buffer.append("UPPER(");
buffer.append(Contacts.ContactMethods.NAME);
buffer.append(") GLOB ?");
args = new String[]
{ constraint.toString().toUpperCase() + "*" };
}
return mContent.query(Contacts.People.CONTENT_URI,
EX05_09.PEOPLE_PROJECTION, buffer == null ? null : buffer.toString(),
args, Contacts.People.DEFAULT_SORT_ORDER);
}
=====

i don't know what is the use of getfilterqueryprovider.
because when i remove the codes below from above the codes still works.
just don't get it. is the code below really an redundant stuff?
(i m using the autocompletetextview with cursoradapter to create a droplist while typing in a edittextview)
====
if (getFilterQueryProvider() != null)
{
return getFilterQueryProvider().runQuery(constraint);
}
====
 
Back
Top Bottom