検索ボックスとして機能する EditText で、類似した単語を見つけるにはどうすればよいですか
誰でも助けることができますか?
ありがとうロッキー
AutoCompleteTextViewのドキュメントに従ってください
AutoCompleteTextView
ユーザーが入力している間、完了の提案を自動的に表示する編集可能なテキストビューです。
ArrayAdapterについても読む
BaseAdapter
任意のオブジェクトの配列に裏打ちされたコンクリート。
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"
};
}
AutocompletetextViewはこれを行うのに最適です:ここにリンクがあります:http ://www.androidaspect.com/2012/06/autocompletetextview-example.html
あなたには2つの選択肢があります
AutoCompleteTextView
でテキストを編集addTextChangedListener
EditTextで簡単に検索してこのリストビューを確認してください