[英]Count of total suggestions as per input data on autocompletetextview - android
如何獲得與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("");
}
}
});
嘗試這個,
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("");
}
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.