如何获得总数的建议,该建议与autocompletetextview上的输入数据完全匹配
placeView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Places item = (Places) parent.getItemAtPosition(position);
if(!place_id.equals("")) {
place_name = item.getPlaceName();
place_id = item.getOnlineId();
place_panchayat_id = item.getPanchayat_name();
} else {
placeView.setText("");
}
}
});
答案 0 :(得分:0)
尝试一下,
placeView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//getCount() Method give the count from the adapter;
int count = parent.getCount();
Places item = (Places) parent.getItemAtPosition(position);
if(!place_id.equals("")) {
place_name = item.getPlaceName();
place_id = item.getOnlineId();
place_panchayat_id = item.getPanchayat_name();
} else {
placeView.setText("");
}
}
});