AutoCompleteTextView
do not propose this feature by default but you could implement it yourself.
- storing each user input in a file or a database (I recommend to use a database)
- retrieving those input and setting an adaptater to the
AutoCompleteTextView
.
Example to set an adpatater with pre defined string array from Google doc:
http://developer.android.com/reference/android/widget/AutoCompleteTextView.html
public class CountriesActivity extends Activity {
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.countries);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
android.R.layout.simple_dropdown_item_1line, COUNTRIES);
AutoCompleteTextView textView = (AutoCompleteTextView)
findViewById(R.id.countries_list);
textView.setAdapter(adapter);
}
private static final String[] COUNTRIES = new String[] {
"Belgium", "France", "Italy", "Germany", "Spain"
};
}
Instead to use a fix array COUNTRIES
like in the example above, use a String array retrieved from the database,