附着的EditText的适配器动态数据适配器、动态、数据、EditText

2023-09-05 05:08:38 作者:余生有你就够了

有没有办法将附加动态适配器的EditText?

Is there a way to attach dynamic adapter to EditText?

我要的是 - 当一个键pssed上的EditText $ P $,我的code做的(一些)自定义存储搜索,并提供建议(而不是静态XML列表或数组)。这家店是不是一个数据库;我觉得CursorAdapter的仅适用于数据库的结果。例如code片段都欢迎。

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-list or array). This store is not a database; I think CursorAdapter is for database results only. Example code snippets are welcomed.

推荐答案

我找到了解决方案,并公布了答案this问题。

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

编写自定义 SimpleCursorAdapter 。覆盖 runQueryOnBackgroundThread()方法并返回基于输入约束实现新MatrixCursor。该适配器关联到自动完成编辑框。

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

我得到的提示为这个答案@ HTTP:/ /thinkandroid.word$p$pss.com/2010/01/11/custom-cursoradapters/

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