我目前正在創建一個聊天應用程序。我嘗試了不同的解決方案,但無法讓他們工作。這是我目前的代碼:如何限制ListAdapter中的數據並在滾動時顯示更多內容?
public void callListView() {
// GET USER LIST
setListAdapter (new SimpleAdapter(
Messages.this, ListOfMsg,
R.layout.messages_list_item, new String[] {
"name",
"message"
},
new int[] {
R.id.sname,
R.id.message
}
));
}
我該如何限制數據只能獲得25個項目?當我滾動時,我將如何獲取更多數據?
在此先感謝。
[無盡的滾動列表視圖的可能的複製](http://stackoverflow.com/questions/20324258/endless-scroll-list-view) –
只需先獲取25個項目,然後獲取new ite毫秒,當你達到底部。 – Zoedia
已經在這裏回答http://stackoverflow.com/questions/16398921/dynamic-listview-adding-load-more-items-at-the-end-of-scroll –