I don't know if there are - never looked there.
However, it's literally just a few lines of code:
- Subclass ResourceCursorAdapter;
- Override bindView to do the usual thing;
- Override runQueryOnBackgroundThread to do something like:
@Override
public Cursor runQueryOnBackgroundThread(CharSequence constraint) {
String filter = constraint == null ? "" : constraint.toString();
Cursor c = mContentResolver.query(<something using "filter">);
if (c != null) {
c.getCount(); // Force data to be sent over right here
}
return c;
}
17.03.2011 14:10, mac-systems пишет:
Is there any API Example about this stuff in the SDK ?
Looks like what i have to use...
On 17 Mrz., 11:56, Kostya Vasilyev<[email protected]> wrote:
17.03.2011 13:47, mac-systems пишет:
Hello,
what would be the best approach to use an ContentProvider and a
AutoCompleteTextView ?
Looks like i have to use the CursorAdapter ?
regards,
Jens
Yep.
It needs a ListAdapter that implements Filterable.
CursorAdapter satisfies those requirements, as does
ResourceCursorAdapter (one less method to override).
You will then need to either override runQueryOnBackgroundThread in the
adapter, or delegate through a FilterQueryProvider.
--
Kostya Vasilyev --http://kmansoft.wordpress.com
--
Kostya Vasilyev -- http://kmansoft.wordpress.com
--
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