我想制作一个列表视图,当用户滚动到列表视图的底部时,其他列表项会自动从互联网填充。我在该可扩展列表视图的适配器中(在 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;
}
那么这是正确的方法还是有什么好的方法呢?