Basic methods of Autocompletetextview use
What is Autocompletetextview? Automatic Reminders .
There must be one thing that provides data to Autocompletetextview. Dropdownmenu
1. Declare a autocompletetextview in the layout file
< Autocompletetextview Android:id = "@+id/autocomplete" android:layout_width= "Match_parent" android:layout_height= "Wrap_ Content "/>
The ID used here is the hump naming method .
2, define a hint entry style, new list_item.xml
<? xml version= "1.0" encoding= "Utf-8" ?> < textview xmlns:android = "Http://schemas.android.com/apk/res/android" Android:layout_width = "Match_parent" Android:textsize = "16sp" Android:textcolor = "#000" Android:layout_height = "Match_parent" > </ textview >
3. Create a arrayadapter to provide data for Autocompletetextview
Here is the dynamic way, not the dead data ~
New Arraylist<string> (); List.add ("ABCD"); List.add ("Abeb"); ArrayadapterNew arrayadapter<string> (this, r.layout.list_item,list); The list can be passed an array here.
4. linking Arrayadapter and Autocompletetextview
Autocompletetextview.setadapter (Arrayadapter);
Enter at least two characters and enter one that does not appear.
timepicker just set the date, this is set time ~!
Basic methods of Android--autocompletetextview use