为什么构造函数ArrayAdapter(new View.OnKeyListener(){},int,String [])在编写时未定义.此编码用于在键入字数超过3个字符时从sqlite获取数据.但是,它显示以下错误.
@H_301_7@ed1 = (AutoCompleteTextView)findViewById(R.id.searchWord); ed1.setOnKeyListener(new View.OnKeyListener() { Integer count = 0; String typeWord = ""; public boolean onKey(View v,int keyCode,KeyEvent event) { if (KeyEvent.ACTION_DOWN == event.getAction()) { if (keyCode != 67) { count++; char c = (char)event.getUnicodeChar(); typeWord = typeWord + c; } else { count--; } if (count > 2 && typeWord != "") { countries = getAutosuggestWord(typeWord); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.autosuggest,countries); ed1.setAdapter(adapter); } } return false; } });The constructor ArrayAdapter(new View.OnKeyListener(){},
String[]) is undefined