使用ListView在setAdapter()后,对ListView的childView做一些操作。但是每次要取得childCount总是0。
原來setAdapter是非同步(asynchronous)。
只要在setAdapter()之后,加入post函式去更新ListView的ChildView即可。
mParent= (ListView)findViewById(R.id.list);
mParent.setAdapter(adapter);
mParent.post(new Runnable(){
public void run(){
//对ListView中的ChildView进行操作。。。
}
}