附着的EditText的适配器动态数据 [英] Dynamic data for Adapter attached to EditText

查看:134
本文介绍了附着的EditText的适配器动态数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法将附加动态适配器的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.

推荐答案

我找到了解决方案,并公布了答案<一个href="http://stackoverflow.com/questions/3542219/dynamically-update-autocomplete-box-in-android">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/

这篇关于附着的EditText的适配器动态数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆