Adapter 回调Acticity

2020-12-11  本文已影响0人  景小帮

Adapter类

private  OnItemClickLitener    mOnItemClickLitener;

//设置回调接口

public interface OnItemClickLitener{

void onItemClick(View view, int position);

}

public void setOnItemClickLitener(OnItemClickLitener mOnItemClickLitener){

this.mOnItemClickLitener = mOnItemClickLitener;

}


Acticity 中调用

titleAdapter.setOnItemClickLitener(new TitleAdapter.OnItemClickLitener() {

@Override

    public void onItemClick(View view, int position) {

    }

});

上一篇 下一篇

猜你喜欢

热点阅读