有个小伙伴遇到了这样一个问题,就是autocompletetextview实现自动填充的功能。同时要具备手机格式化的功能。下拉列表最后一行是有个清除历史的功能。可是点击“清除历史”却把文字要设置进去autocompletetextview中。这样的效果显然很糟糕。所以我就写了这样一个简单的demo。来帮助遇到这种问题的朋友解决这样一个问题。二话不多说直接上代码。
布局文件(activity_main.xml)代码如下:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="please input:" />
android:id="@+id/ac