怎样的android一个EditText工作自动完成 [英] android how an EditText work as AutoComplete
问题描述
我希望我的的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屋!