0
我想做一个列表视图,当用户滚动到列表视图的底部其他项目的列表自动填充internet.I编写代码到该可扩展列表视图的适配器(在getGroupView()方法)像这样,如何更新用户向下滚动的列表视图?
public View getGroupView(final int arg0, final boolean arg1, View arg2, ViewGroup arg3) {
//if(arg2==null){
//arg2=act.getLayoutInflater().inflate(R.layout.layout_exlistview_group, null);
}
//((TextView)arg2.findViewById(R.id.nameText)).setText(item.getItemName());
if(arg0>=getGroupCount()-1){//chech is near for end
/*here i run a asynctask to download data and add items to SparseArray of this class.That sparsearray is the source to the adapter to view them in listview*/
}
//return arg2;
}
那么这是正确的方式来做到这一点,或者有没有什么好办法做到这一点?
这应该有助于http://benjii.me/2010/08/endless-scrolling-listview-in-android/ – Swayam