在Autocompletetextview项目上单击获取Firebase数据库的整行

时间:2017-01-14 10:31:53

标签: java android autocomplete android-adapter

我想在自动完成文本视图中单击的项目的同一行中显示一些特定值。

final AutoCompleteTextView autoCompleteTextView= (AutoCompleteTextView)findViewById(R.id.autocompleteView);
    autoCompleteTextView.setAdapter(autoComplete);
    autoCompleteTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3)
        {
            String item = (String) arg0.getItemAtPosition(arg2);
            Toast.makeText(MapActivity.this, item, Toast.LENGTH_LONG).show();

        }
    });

0 个答案:

没有答案