问题标签 [autocompletetextview]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
android - 如何使用每个建议行旁边的图标创建自定义 AutoComleteTextView - Android
我想在每个建议行中创建一个AutoCompleteTextView
带有图标的自定义。textView
我怎样才能做到这一点?
android - 致命异常 ClassCastException 与 performFiltering 上的 autocompletetextview 下拉列表
我有一个用于获取新数据并过滤它的 AutoCompleteTextView 的自定义 performFiltering:
如果我键入两个检索大量目的地的字母并向下滚动,我会得到一个 FC 和以下堆栈跟踪:
如果我最多返回 5 个结果,它就可以正常工作(我只需添加以下内容):
我已在AutoCompleteTextView的第 1350 行的 Android 源代码中将错误跟踪到以下内容,该代码执行以下操作:
但是,我不明白为什么当结果大于 5 并且您开始滚动时,此代码会收到错误的类。将结果限制为 5 的解决方案很难看,因为我觉得真正的问题仍然存在。有人有什么建议吗?
这是自动完成项的 xml 布局(但没有自定义下拉实现):
android - Why does getText() and getEditableText() on a AutoCompleteTextView always yield an empty string?
The goal for my project is save the login ID and also, when user types in login ID if it is already saved, it should auto complete.
I am trying to save the entered values to a SQLite DB and then read it from there to populate the auto complete text view. The problem I am facing is, on trying to read the entered text before or after clicking the sign in button, the string is always "" (empty). I am not sure why this is always empty. I have tried to read the string in onCreate () as well as loginOnClick(View v). Both places I get an empty string. Here is the code:
android - android如何使AutoCompleteTextView作为谷歌搜索框工作
在我的应用程序中,我有一个 Activity 扩展MapActivity
。在那里我放了AutoCompleteTextView
一个名为“搜索”的按钮,所以我在里面写的内容AutoCompleteTextView
并按下搜索按钮,它会转到谷歌地图中的那个位置。适用于我在strings.xmlAutoCompleteTextView
中提到的少量项目。但我希望它应该用作谷歌搜索引擎,就像在谷歌搜索框中一样,无论我们开始编写它,它都会自动完成那里的每个单词。事情是它从谷歌服务器获取数据。是不是?如果是,那么我如何将数据从 Google 服务器绑定到我的AutoCompleteTextView以便它用作 Google 搜索框。我正在使用安卓 API v2.2。
android - AutoCompleteTextView (Android) 上的侦听器
我有一个带有 anAutoCompleteTextView
和 a的 Activity 带有一个ListView
扩展的适配器BaseAdapter
。
当 Activity 开始并且AutoCompleteTextView
为空时,ListView
显示完整的项目列表。当用户开始输入AutoCompleteTextView
并选择提示时,OnItemClickListener
我会调用:
这只会用一些项目重新加载适配器。这很完美,但是当用户清理 时AutoCompleteTextView
,什么也没有发生。
我想关联一个Listener
在用户清理时启动的,而不按 Enter 键。
有没有listener
这样做的?
谢谢!
android - 是否可以为 AutoCompleteTextView 使用两个不同的过滤器
我正在开发一个小型 Android 应用程序的搜索栏。我遇到了这个问题,我几乎一周都无法弄清楚。
基本思想是当用户在我的搜索栏上输入内容时,我想为用户提供一些搜索建议。这是一个相当标准的AutoCompleteTextView
问题。
但是这里很复杂,因为我要向用户建议两个不同的数据源。
第一个数据(localData)有点快,我想在用户输入内容时直接向用户建议,第二个数据(remoteData)我将发送一个 Internet API 请求来检索数据并将数据附加到前一个数据中,然后更新下拉列表。
所以我想要两个线程,performFiltering
并且publishResults
将运行两次,一个用于本地,另一个用于远程请求。
有人有什么建议吗?
android - ArrayAdapter 在 AutoCompleteTextAdapter 中从 Webservice 更新较晚
我有一个使用 ArrayAdapter 的 AutocompleteTextView。当文本更改时,适配器会从 Web 服务更新。此更新是在 AsyncTask 中完成的,这应该是一个很好的做法。这或多或少是有效的,因为每次按下按键后的建议都是基于在上一次按下的按键中检索到的字符串。这个页面有几个相关的问题,但没有一个答案对我有用。无论如何,我有一个解决方案,但效率低下,我不知道为什么“官方解决方案”会失败。
我认为关键在于在后台更新 de ArrayAdapter 的功能。这就是我在对 web 服务的异步调用中所做的:
我已经尝试使用 mAutoCompleteAdapter.clear() 并在任何地方设置 mAutoCompleteAdapter.notifyDataSetChanged() ,但它没用。
android - 如何在 AutoCompleteTextView 上启用退格?
退格在 AutoCompleteTextView 上不起作用,尤其是当用户从下拉列表中选择了一个项目时。这是一个反复出现的问题吗?我是否忘记了(隐藏得很好的)许可?
仅供参考:Android 2.2 编程
问候
android - Android:带有默认建议的 AutoCompleteTextView
如何在用户键入任何内容之前显示一些 AutoCompleteTextView 的默认建议?即使创建一个扩展 AutoCompleteTextView 的自定义类,我也找不到这样做的方法。
我想显示常见输入值的建议,以使用户免于输入。
有什么建议么?
android - 如何在 android 中为 edittext 字段显示多个值的建议?
我需要 android 应用程序中的一个功能,它类似于 android 真实设备中的 Gmail 应用程序,它在“To”字段中下拉了多个值的建议,或者像堆栈溢出的多个值的标签建议。例如,我在“收件人”字段中输入了一个电子邮件地址,然后我需要在逗号值之后列出输入文本的电子邮件地址,我为此功能搜索了很多,但我找不到确切的解决方案。请提供建议,任何帮助将不胜感激。