在ListView完成刷新后我们如果需要做些事情可以给它添加一个listener:
mSongsList.addOnLayoutChangeListener(new View.OnLayoutChangeListener() { @Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { } } 每次在listView的adapter的notifyDatechange调用后这个onLayoutChange都会被回调,我们就可以在这里做些我们想要的事情。
本文介绍如何在ListView完成刷新后执行特定操作,通过添加OnLayoutChangeListener监听器,在adapter的notifyDataSetChanged调用后自动触发回调函数,实现自定义逻辑。

3932

被折叠的 条评论
为什么被折叠?



