//1.声明listenenr
private RefreshListener listener;
//2.接口,里面一个方法
public interface RefreshListener{
public void onRefresh(XListview view);
}
//3.set方法
public void setRefreshListener(RefreshListener listener){
this.listener=listener;
}
//4.在某个方法里写listener调用onRefresh
listener.onRefresh(XListview.this);
//5.在Activity里接口RefreshListener,重写onRefresh();
public void onRefresh(XListview view) {
}
对android 回调机制的总结
最新推荐文章于 2021-06-04 13:46:35 发布