我们如何检测用户是否从建议列表中选择了地址,并且未使用Google Places API在自动填充文字视图中接受其他条目,例如“kjkshkjjhd”?
AutoCompleteTextView places = (AutoCompleteTextView) findViewById(R.id.autocomplete);
places.setAdapter(new PlacesAutoCompleteAdapter(this,android.R.layout.simple_dropdown_item_1line ));
places.setOnItemClickListener(this);
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
// TODO Auto-generated method stub
String str = (String) adapterView.getItemAtPosition(position);
Toast.makeText(this, str, Toast.LENGTH_SHORT).show();
}