开发者

Dynamic data for Adapter attached to EditText

开发者 https://www.devze.com 2023-01-10 00:07 出处:网络
Is there a way to attach dynamic adapter to EditText? What I want is - when a key is pressed on EditText, my code to do a search in (some) custom store and provide suggestions (instead of static Xml开

Is there a way to attach dynamic adapter to EditText?

What I want is - when a key is pressed on EditText, my code to do a search in (some) custom store and provide suggestions (instead of static Xml开发者_StackOverflow社区-list or array). This store is not a database; I think CursorAdapter is for database results only. Example code snippets are welcomed.


I found the solution and posted the answer to this question.

Write a custom SimpleCursorAdapter. Override runQueryOnBackgroundThread() method and return a new MatrixCursor based on the input contraint. Associate this adapter to the autocomplete editbox.

I got the hint for this answer @ http://thinkandroid.wordpress.com/2010/01/11/custom-cursoradapters/

0

精彩评论

暂无评论...
验证码 换一张
取 消