AutoCompleteTextView
にはListView
があり、リストの最初の文字を返します。Androidオートコンプリートテキストビューの文字を入力すると、リストビューのすべての単語が返されます。
しかし、私はすべての言葉が必要です。例
については
次のように "" それは返すべきで入力すると "" それは、
ananthi
vasanthi
ravi
を返す必要があります入力すると、私は、
ananthi
qwerty
vasanthi
ravi
のデータのリストを持っています
ananthi
vasanthi
しかし、文字列の文字を開始からのみ動作し
public class MainActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final String[] AndroidDesk= {"ananthi","qwerty ","vasanthi","ravi"};
ArrayAdapter<String> My_arr_adapter= new ArrayAdapter<String>(getApplicationContext(),android.R.layout.simple_dropdown_item_1line,AndroidDesk);
AutoCompleteTextView My_auto_Cmplt_Tv=(AutoCompleteTextView)findViewById(R.id.autotv);
My_auto_Cmplt_Tv.setThreshold(2);
My_auto_Cmplt_Tv.setAdapter(My_arr_adapter);
My_auto_Cmplt_Tv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(),(CharSequence)arg0.getItemAtPosition(arg2), Toast.LENGTH_LONG).show();
}
});
}
が可能です。 [Ryanの回答](https://stackoverflow.com/a/30113650/5588347)を試してみましたか? [投稿](https://stackoverflow.com/questions/9032707/custom-autocompletetextview-behavior)はあなたのものと似ています。 –