怎样的android一个EditText工作自动完成 [英] android how an EditText work as AutoComplete

查看:175
本文介绍了怎样的android一个EditText工作自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的的EditText 应该为自动完成,因为我写的XML文件

I want my EditText should work as AutoComplete, for that I write in XML file

android:inputType="textAutoComplete|textAutoCorrect"

但它不工作。

but its not working.

我正与API V2.2和我的活动来延长 MapActivity ,还有我把一个简单的的EditText 和一个名为搜索按钮。所以如果我们键入的EditText 的位置名称和preSS搜索按钮意味着它应该去的位置在地图上。 所以我想,的EditText 应该为自动完成。 我怎样才能做到这一点? 谢谢

I am working with API v2.2 and my activity extends MapActivity, there I put a simple EditText and a button named "Search". so if we type the location name in EditText and press search button means it should go to that location in map. So i want that EditText should work as AutoComplete. How can i do that? Thank you

推荐答案

只是使用了 AutoCompleteTextView ,而不是正常的的EditText

Just use an AutoCompleteTextView instead of normal EditText.

<一个href="http://developer.android.com/resources/tutorials/views/hello-autocomplete.html">hello-autocomplete会有所帮助。

这篇关于怎样的android一个EditText工作自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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